Re: ExtAudioFileRead and seeking from non-zero
Re: ExtAudioFileRead and seeking from non-zero
- Subject: Re: ExtAudioFileRead and seeking from non-zero
- From: Jens Alfke <email@hidden>
- Date: Tue, 27 Jan 2009 17:43:05 -0800
On Jan 27, 2009, at 5:33 PM, Evan Olcott wrote:
further investigation into this is leaning me towards this
unexpected behavior having something to do with "leading frames" in
the converter, but I'm not sure how to fix/address that with the
API, or even if that's really the real problem.
You didn't explain what the pre-initialized variable 'frames' is for,
but it seems to represent the total number of frames you expect to
read out of the file. Presumably you got that by querying some
audiofile property. Trouble is, the value may not be exact, depending
on what property you ask for. In some formats like MP3 it's very
expensive to determine the true number of frames (it has to read
through the entire file first).
Rather than trying to figure out how many frames to read ahead of
time, you should probably just read frames until you hit the EOF. At
that point you know exactly how many frames were in the file :)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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