Re: [Mpg123-users] Decoding small clip of mpeg audio
Brought to you by:
sobukus
|
From: Thomas O. <tho...@or...> - 2008-06-29 23:30:09
|
Am Sun, 29 Jun 2008 23:22:05 +0100 schrieb Nicholas J Humfrey <nj...@ec...>: > Has anyone tried using mpg123 to decode small sections of a large MP3 > to Wave file? I'd bet on it;-) > I have some MPEG Audio files, that I want to extract 30 second clips > from. It would be nice if I could give mpg123 the time ranges that I > want to extract. In a way, you can. > I guess with CBR files, I could do it using frame > counting, but it would be nice to just pass the times directly to > mpg123. Oh, that has nothing to do with CBR. A file can as VBR as it likes, the time per frame (number of samples) is fixed, as long as the file doesn't vary between MPEG versions/layers. So for a off-the-street mp3 you can calculate time = frames * 1152 / samplingrate > Before I start looking at hacking support into mpg123 There is not much hacking needed... the control interface already knows a command to seek to a specific position in seconds. The libmpg123 API actually has a seek function using samples. We just need to settle on the names for the new command line parameters;-) Suggestions? > -k num, --skip num > -n num, --frames num Right, you can already use that to get 10 frames from the 100th frame on... the inconveniency is to have some knowledge about what a frame means. Alrighty then, Thomas (who is reworking httpget.c with the added goal of IPv6 at the moment). |