I did so: changed my RemoteIO ASBD to use kAudioUnitFlagsCanonical. On the device and simulator I get identical, correctly pitched but garbled sound as before.
AudioBuffer *leftAudioBuffer = &buffers->mBuffers[0];
AudioBuffer *rightAudioBuffer = &buffers->mBuffers[1];
SInt16 *leftData = (SInt16 *) leftAudioBuffer->mData;
SInt16 *rightData = (SInt16 *) rightAudioBuffer->mData;
engine->getStereoSamples(_tmpBuf, numFrames);
for (int i = 0; i < numFrames; i++) {
leftData[i] = OSSwapHostToLittleConstInt16(_tmpBuf[i].left * INT16_MAX);
rightData[i] = OSSwapHostToLittleConstInt16(_tmpBuf[i].right * INT16_MAX);
}
return noErr;
Tried various OSSwapXXtoYY with identical results each time, and no swap also with identical results. The floats (ie _tmpBuf[i].left and .right) are in the range -1.0..1.0 as they should be.
Turned off the recording stuff for now until I've pinned down the correct generation code.
On 6 Dec 2012, at 10:12, Joel Reymont wrote:
On Thu, Dec 6, 2012 at 2:58 PM, Tim Kemp <
email@hidden> wrote:
It's required for extended audio file services.
I don't think so.
Plus, you are not doing little to big endian conversion in your code,
hence the garbled data.
Remove the big endian flags and try again.
--------------------------------------------------------------------------
for hire: mac osx device driver ninja. kernel, usb and coreaudio drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs |
http://www.linkedin.com/in/joelreymont---------------------+------------+---------------------------------------