Derek at CD Baby
2004-Sep-10 16:45 UTC
[Flac-dev] command-line flac tool to report song length?
I've got a bunch of flac files and need to report their length. With MP3s, you use `mp3info -x $filename` But is there a way to find out the length (minutes:seconds or just seconds) of a flac audio file, without converting it to WAV first? Thanks! -- Derek Sivers, CD Baby, Hostbaby http://www.cdbaby.com <-- best new independent music http://www.hostbaby.com <-- web hosting for musicians
You can probably do this with shntool: http://www.etree.org/shnutils/shntool/ MW On Tue, 28 Oct 2003, Derek at CD Baby wrote:> I've got a bunch of flac files and need to report their length. > > With MP3s, you use `mp3info -x $filename` > > But is there a way to find out the length (minutes:seconds or just seconds) of a flac audio file, without converting it to WAV first? > > Thanks! > > > -- > Derek Sivers, CD Baby, Hostbaby > http://www.cdbaby.com <-- best new independent music > http://www.hostbaby.com <-- web hosting for musicians > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Flac-dev mailing list > Flac-dev@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flac-dev >
Steven Richman
2004-Sep-10 16:45 UTC
[Flac-dev] command-line flac tool to report song length?
Hi Derek, If you are on a system that has "tr", "awk", and pipelines, the following should give you the duration in seconds: metaflac --show-total-samples --show-sample-rate foo.flac | tr '\n' ' ' | awk '{print $1/$2}' - ,steven. On Tue, 28 Oct 2003, Derek at CD Baby wrote:> I've got a bunch of flac files and need to report their length. > > With MP3s, you use `mp3info -x $filename` > > But is there a way to find out the length (minutes:seconds or just seconds) of a flac audio file, without converting it to WAV first?
Svante Eriksson
2004-Sep-10 16:45 UTC
[Flac-dev] command-line flac tool to report song length?
"DaCB" == Derek at CD Baby <dereklist@cdbaby.com> writes: DaCB> But is there a way to find out the length (minutes:seconds or DaCB> just seconds) of a flac audio file, without converting it to WAV DaCB> first? One way is to use the output from `metaflac' with the options `--show-sample-rate' and `--show-total-samples'. /S -- svante at eriksson dot name
Matt Zimmerman
2004-Sep-10 16:45 UTC
[Flac-dev] command-line flac tool to report song length?
On Tue, Oct 28, 2003 at 10:38:54PM -0800, Derek at CD Baby wrote:> I've got a bunch of flac files and need to report their length. > > With MP3s, you use `mp3info -x $filename` > > But is there a way to find out the length (minutes:seconds or just > seconds) of a flac audio file, without converting it to WAV first?You can get this indirectly from metaflac by calculating it from the sample rate, channels and total samples. It could presumably be enhanced to calculate it into a nicely-formatted time display. -- - mdz