Re: Slow seeking in MP3 files using ExtAudioFile
Re: Slow seeking in MP3 files using ExtAudioFile
- Subject: Re: Slow seeking in MP3 files using ExtAudioFile
- From: Markus Fritze <email@hidden>
- Date: Tue, 20 Jan 2009 13:56:39 -0800
MP3 is a streaming format, to find a sample position inside the file
this reading is required. However, iTunes 5 or later, GarageBand and
Logic write some additional information into the MP3 file, which
allows you to find the position without reading everything.
Markus
On Jan 20, 2009, at 1:46 PM, Jens Alfke wrote:
I'm working on an app that does random-access playback of MP3 and
AAC files. It uses ExtAudioFile to read and decode the files. I'm
finding that changing the playback position in a file can be very
expensive — for example, I open a 20-minute MP3 file, seek to a
point about 5 minutes in, and then the first call to
ExtAudioFileRead takes over two seconds. During this time, the MP3
decoder is issuing large numbers of fstats 32k reads; it seems to be
reading from the start of the file all the way to the point its
seeked to.
Is this to be expected? Granted, this is a VBR file so the mapping
from time to byte offset isn't linear, but I thought there was a
table in the file that served as a TOC. Or is there really no faster
way for the decoder to seek than to read MPEG frames until it finds
the right time?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden