I'm trying to adapt the code from <CoreAudio/SimpleSDK/DefaultOutputUnit> to serve as a back end to allow my music composition program to play sounds.
In DefaultOutputUnit the audio data is non-interleaved; I need to change it so that the data is interleaved. One obvious thing to change is theFormatFlags, from
UInt32 theFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kLinearPCMFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved;
to
UInt32 theFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kLinearPCMFormatFlagIsPacked
Also, since there are two channels, there should be one buffer (twice the size of the buffers in the non-interleaved case), not two.
Question 1: How do I set that up? Question 2: What else do I need to change?
|