<div dir="ltr">sndfile_info checks both the header and the file contents.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 17, 2016 at 11:50 PM, Eric Wong <span dir="ltr"><<a href="mailto:e@80x24.org" target="_blank">e@80x24.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Dan Hitt <<a href="mailto:dan.hitt@gmail.com">dan.hitt@gmail.com</a>> wrote:<br>
> I'm looking for a command line tool that can determine the length<br>
> (duration in seconds) of a sound file using more than just the file<br>
> header.<br>
<br>
</span>Try: sox $FILE -n stats 2>&1 | awk '/^Length / {print $2}'<br>
<br>
That will decode the entire file and run it through the<br>
sox "stats" effect.<br>
<br>
I just tried it on a 28MB FLAC file (3:49.80s) truncated to 5MB<br>
with:<br>
<br>
        dd if=$ORIG of=truncated.flac bs=5M count=1<br>
<br>
And was able to reproduce soxi showing the the length as<br>
3:49.80 but "sox .. -n stats" showed only 44.304s<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Linux-audio-user mailing list<br>
<a href="mailto:Linux-audio-user@lists.linuxaudio.org">Linux-audio-user@lists.<wbr>linuxaudio.org</a><br>
<a href="http://lists.linuxaudio.org/listinfo/linux-audio-user" rel="noreferrer" target="_blank">http://lists.linuxaudio.org/<wbr>listinfo/linux-audio-user</a><br>
</div></div></blockquote></div><br></div>