Re: [LAU] robust command line tool to determine duration of sound file using more than the header

From: Paul Davis <paul@email-addr-hidden>
Date: Thu Aug 18 2016 - 15:13:36 EEST

sndfile_info checks both the header and the file contents.

On Wed, Aug 17, 2016 at 11:50 PM, Eric Wong <e@email-addr-hidden> wrote:

> Dan Hitt <dan.hitt@email-addr-hidden> wrote:
> > I'm looking for a command line tool that can determine the length
> > (duration in seconds) of a sound file using more than just the file
> > header.
>
> Try: sox $FILE -n stats 2>&1 | awk '/^Length / {print $2}'
>
> That will decode the entire file and run it through the
> sox "stats" effect.
>
> I just tried it on a 28MB FLAC file (3:49.80s) truncated to 5MB
> with:
>
> dd if=$ORIG of=truncated.flac bs=5M count=1
>
> And was able to reproduce soxi showing the the length as
> 3:49.80 but "sox .. -n stats" showed only 44.304s
> _______________________________________________
> Linux-audio-user mailing list
> Linux-audio-user@email-addr-hidden
> http://lists.linuxaudio.org/listinfo/linux-audio-user
>

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Thu Aug 18 16:15:02 2016

This archive was generated by hypermail 2.1.8 : Thu Aug 18 2016 - 16:15:02 EEST