I am successfully using a 3D Mixer Audio Unit along with a FilePlayer AudioUnit (and a Converter Unit to handle the mono input for the mixer) in a simple AUGraph (no rendering callback, just the connected nodes).
Everything works fine, even the HiPass of the occlusion effect, except that there are hearable clicks in the audio, when I'm setting the k3DMixerParam_OcclusionAttenuation
.
"When I'm setting" means "while the parameter set, there's this millisecond long clicking noise."
// this produces clicks
AudioUnitSetParameter(_mixerUnit, k3DMixerParam_OcclusionAttenuation, kAudioUnitScope_Input, bus, occlusion, 0);
// azimuth & distance work fine without clicks
AudioUnitSetParameter(_mixerUnit, k3DMixerParam_Azimuth, kAudioUnitScope_Input, bus, azimuth, 0);
AudioUnitSetParameter(_mixerUnit, k3DMixerParam_Distance, kAudioUnitScope_Input, bus, distance, 0);
Note: removed result checks for improved legibility. All results are okay.
If I comment out the occlusion attenuation, setting azimuth and distance works fine, without any audible noises. The more I decrease the occlusion attenuation (e.g. with it's minimum value of -100db), the clicks get nastier and louder.
I tried increasing the maximum frames per slice, decreasing the gain, to no avail. I tried using scheduled parameters, as I thought it might be better to ramp the value, but unfortunately none of the parameters support scheduling.
Any tips what this could be and how to avoid it?