Kevin Seghetti
2004-Sep-10 16:47 UTC
[Flac-users] is there a way to read the length of a song from the command line?
I am working on an audio jukebox and would like to read the length of a song (minutes:seconds) from a perl script. Is there a way to do that? I don't see anything in the docs for flac or metaflac. Thanks, -- Kevin Seghetti: E-Mail: kts@tenetti.org, HTTP: www.tenetti.org GPG public key: http://tenetti.org/phpwiki/index.php/KevinSeghettiGPGKey Check out www.worldfoundry.org for my GPL'ed 3D video game engine Copyright is a temporary loan from the public domain, not property -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.xiph.org/pipermail/flac/attachments/20040619/54bb9e7e/attachment.pgp
Josh Coalson
2004-Sep-10 16:47 UTC
[Flac-users] is there a way to read the length of a song from the command line?
--- Kevin Seghetti <kts@tenetti.org> wrote:> I am working on an audio jukebox and would like to read the length of > a > song (minutes:seconds) from a perl script. Is there a way to do that? > I > don't see anything in the docs for flac or metaflac.you can get the total number of samples with metaflac --show-total-samples file.flac then get the sample rate with metaflac --show-sample-rate file.flac divide the first by the second and that gets you the number of seconds. there is also a perl module Audio::FLAC that does all this: http://search.cpan.org/~daniel/Audio-FLAC-0.7/FLAC.pm Josh __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail
Kevin Seghetti
2004-Sep-10 16:47 UTC
[Flac-users] is there a way to read the length of a song from the command line?
Thanks, that worked great. On Sun, 2004-06-20 at 14:36, Josh Coalson wrote:> --- Kevin Seghetti <kts@tenetti.org> wrote: > > I am working on an audio jukebox and would like to read the length of > > a > > song (minutes:seconds) from a perl script. Is there a way to do that? > > I > > don't see anything in the docs for flac or metaflac. > > you can get the total number of samples with > > metaflac --show-total-samples file.flac > > then get the sample rate with > > metaflac --show-sample-rate file.flac > > divide the first by the second and that gets you the number of > seconds. > > there is also a perl module Audio::FLAC that does all this: > > http://search.cpan.org/~daniel/Audio-FLAC-0.7/FLAC.pm > > Josh > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer > Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND > _______________________________________________ > Flac-users mailing list > Flac-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flac-users-- Kevin Seghetti: E-Mail: kts@tenetti.org, HTTP: www.tenetti.org GPG public key: http://tenetti.org/phpwiki/index.php/KevinSeghettiGPGKey Check out www.worldfoundry.org for my GPL'ed 3D video game engine Copyright is a temporary loan from the public domain, not property -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.xiph.org/pipermail/flac/attachments/20040620/ad0b4ecb/attachment.pgp