Currently in my MP3 player (using libmad) I have to scan through an entire mp3 to calculate an accurate playtime and build up a random access seek table.
On the platform I'm using, this can be very slow taking 3 minutes plus for a 35 minute vbr file.
Is there a better way of calculating the length of an mp3 if it isn't in the id3 tag, and/or a better way of jumping to a certain time frame within an mp3 without having scanned the entire thing beforehand?
TIA!
Yours Unwhettedly, Robert John Shepherd.
Editor DVD REVIEWER The UK's BIGGEST Online DVD Magazine http://www.dvd.reviewer.co.uk
For a copy of my Public PGP key, email: pgp@robertsworld.org.uk
With CBR of course, you can guestimate the file offset based on the bit rate. With VBR and no seek table, it ain't gunna be pretty. Maybe you could sample the bitrate at large intervals in the file and use that as a rough guide.
The app I'm working on right now caches an index of frame offsets in a file the first time the MP3 is loaded. Subsequent loadings of the MP3 are instantaneous.
If you figure out anything new on this topic, please let me know.
On Thu, 29 Jul 2004 14:40:35 +0100, Robert John Shepherd robert@reviewer.co.uk wrote:
Currently in my MP3 player (using libmad) I have to scan through an entire mp3 to calculate an accurate playtime and build up a random access seek table.
On the platform I'm using, this can be very slow taking 3 minutes plus for a 35 minute vbr file.
Is there a better way of calculating the length of an mp3 if it isn't in the id3 tag, and/or a better way of jumping to a certain time frame within an mp3 without having scanned the entire thing beforehand?
TIA!
Yours Unwhettedly, Robert John Shepherd.
Editor DVD REVIEWER The UK's BIGGEST Online DVD Magazine http://www.dvd.reviewer.co.uk
For a copy of my Public PGP key, email: pgp@robertsworld.org.uk