I am working on understanding Core Audio, or rather: Extended Audio File Services
Here, I want to use ExtAudioFileRead()
to read some audio data from a file
I also had the same problem with mNumberBuffers > 1,,... My work around involved creating my own internal buffer:
something like:
char buffer1[byteSize]; char buffer2[byteSize]; ......
you could also use pointers to make things easier,..like:
buffer[index][byteSize];
then you would have to iterate through them manually and fill them up on the main thread to avoid glitches in audio.
ExtAudioFileRead will only fill buffer[0] in the AudioBufferList, you could then have that pointing to different manually allocated buffers as the audio plays.
hope this helps.