Dear all,
I'm trying to convert the float, interleaved data from an stereo audio unit to a uninterleaved, signed PCM format for writing out an AIFF file. That is, I have an AudioBufferList with two data pointers, mBuffers[0].mData and mBuffers[1].mData.
My question is how can I supply these buffers to AudioConverterConvertBuffer(), since it needs a single pointer and I have two. From API:
extern OSStatus AudioConverterConvertBuffer(
AudioConverterRef inAudioConverter,
UInt32 inInputDataSize,
const void*inInputData,
UInt32*ioOutputDataSize,
void*outOutputData);
inInputDataSize must be (mBuffers[x].mDataByteSize * mNumberBuffers), otherwise the call returns an insz error. It seems right. But, which pointer should I pass as inInputData? If I put mBuffers[0].mData, only first channel is processed, and the same if I do with mBuffers[1].mData. I have no idea of what's the correct answer, could anyone give me a pointer to the right direction?
I tried also to uninterleave it manually to a buffer, but then, setting the AudioConverter's input description turning on the flag kAudioFormatFlagIsNonInterleaved, it complains with a 'fmt?' error.
Thanks in advance, and sorry if this is a really stupid question. I'm a newbie with this.