Dear list,
I had no problem implementing 3DMixer for MacOS. Now, I am trying to implement it on iPhone OS, and I have an error when trying to set the rendering flags and the spatial algorithm for each input bus of the mixer. Despite of this error, my graph can be initalized and the audio stream can be processed (i.e. I hear my sound samples) ... I don't understand why. Is there known errors with the "iPhone" version of the 3DMixer units ?
Best regards,
Antoine
------------------------------ Here is a sample code, executed just before the mixer node and output node are connected and before the graph is initialized :
UInt32 render_flags_3d; UInt32 renderFlagSize = sizeof(render_flags_3d); UInt32 spatAlgo = kSpatializationAlgorithm_HRTF; for (UInt32 inBuses = 0; inBuses < 3; inBuses++) {
result = AudioUnitGetProperty (mixer, kAudioUnitProperty_3DMixerRenderingFlags, kAudioUnitScope_Input, inBuses, &render_flags_3d, &renderFlagSize);
render_flags_3d |= k3DMixerRenderingFlags_DistanceDiffusion;
result = AudioUnitSetProperty(mixer, kAudioUnitProperty_3DMixerRenderingFlags, kAudioUnitScope_Input, inBuses, &render_flags_3d, sizeof(render_flags_3d));
result = AudioUnitSetProperty(mixer, kAudioUnitProperty_SpatializationAlgorithm, kAudioUnitScope_Input, inBuses, &spatAlgo, sizeof(spatAlgo));
} ------------------------------ |