(1) why is it calling my renderNotifyProc with inBusNumber=0 only ? I set the buscount with
UInt32 size = sizeof(UInt32);
UInt32 busCount = 128;
err = AudioUnitSetProperty ( mMixer3d,
kAudioUnitProperty_BusCount,
kAudioUnitScope_Input,
0,
&busCount,
size);
I set the bus count right before AUGraphInitialize(). Is this the wrong time?
I want to use the prerender notification to install the renderproc for that bus (if I'm ready to play that sound). I guess I'm fuzzy on when it will call PreRender.
(2) Once I install a renderProc, how do I signal CA that it should stop calling the renderproc and call the renderNotifyProc kAudioUnitRenderAction_PostRender? Or for that matter how does it know it should keep calling me for that bus (if I need multiple slices)?
The documentation and examples all seem to be less than clear on these two questions. Most of the examples seems to be one shot sound players (I need for example to stop a sound when the game says to in mid render) or openal, which is pretty ugly as an example.
FYI all of my sounds are in the correct format and in RAM so all I need to do is copy in the supplied buffers.
- andrew
wwiionline.com