Incorrect results from ExtAudioFileTell
Incorrect results from ExtAudioFileTell
- Subject: Incorrect results from ExtAudioFileTell
- From: Jens Alfke <email@hidden>
- Date: Mon, 12 Sep 2005 21:22:23 -0700
I'm using the ExtAudioFile API to read decompressed PCM samples from
MP3 files. (Actually I'm using CAAudioFile, CAAudioFileReader and
related classes from the PublicUtility code in the SDK.)
ExtAudioFileTell is causing me some confusion, though. Its results
are often not what I expect. In particular:
1. If I call ExtAudioFileSeek(file,0), the result of ExtAudioFileTell
will be -1152. I think the discrepancy corresponds to the empty
"leader" frames at the start of the file (the
kAudioConverterPrimeInfo property reports 1152 leading frames), but
it seems odd that Seek and Tell would disagree about how to number
the frames!
2. After reading from the file, ExtAudioFileTell often returns a
larger value than the number of frames I've read so far. That is, if
I do a 'tell' before and after a 'read', the difference between the
two 'tell's is often greater than the number of frames read. For
example, 'tell' changes from -1152 to 65664 after I read 32768 frames.
The result is that CAAudioFileReader::GetCurrentFrame(), which my
code uses, returns incorrect values.
Is ExtAudioFileTell just not reliable when the ExtAudioFile is using
a converter to decompress the audio? I'm suspecting that it might be
reporting the number of frames decoded by the converter, not the
number the client has read from the file. If so, is the workaround
just to keep my own count of the number of frames I've read?
--Jens
_______________________________________________
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