Re: ExtAudioFileRead ioNumberFrames parameter can only be adjusted downward?
Re: ExtAudioFileRead ioNumberFrames parameter can only be adjusted downward?
- Subject: Re: ExtAudioFileRead ioNumberFrames parameter can only be adjusted downward?
- From: patrick machielse <email@hidden>
- Date: Wed, 28 Sep 2011 17:06:56 +0200
Op 23 sep. 2011, om 23:55 heeft Doug Wyatt het volgende geschreven:
> Be sure that before each call to ExtAudioFileRead you are setting each mDataByteSize in the AudioBufferList to be consistent with the number of frames you are requesting. The read will be limited to the smaller of the number of frames requested and the capacity of the buffer as expressed in mDataByteSize.
Aha! Yes, that helped. Thanks!
Reading the documentation again:
"On output, the number of frames actually read. Fewer frames may be read than were requested. For example, the supplied buffers may not be large enough to accommodate the requested data."
I now see how that comment is meant. The buffer was always large enough but I didn't realize mDataByteSize was altered during the function call. So essentially the # of requested frames info needs to be supplied twice to ExtAudioFileRead(), and the # of fetched frames is also returned in two locations.
In retrospect I might have preferred receiving an error code when asking for more frames than my buffer size allowed.
patrick
--
Patrick Machielse
Hieper Software
http://www.hieper.nl
email@hidden
_______________________________________________
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