I've managed to add a reverb unit to my graph, more or less like so:
AudioComponentDescription auEffectUnitDescription;
auEffectUnitDescription.componentType = kAudioUnitType_Effect;
auEffectUnitDescription.componentSubType = kAudioUnitSubType_Reverb2;
auEffectUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
AUGraphAddNode(
processingGraph,
&auEffectUnitDescription,
&auEffectNode),
Now how can I change some of the parameters on the reverb unit? I'd like to change the wet/dry ratio, and reduce the decay time.
First, you have to get a reference to the actual reverb Audio Unit:
AudioUnit reverbAU = NULL;
AUGraphNodeInfo(processingGraph, auEffectNode, NULL, &reverbAU);
Now that you have the Audio Unit you can set parameters on it, like
// set the decay time at 0 Hz to 5 seconds
AudioUnitSetParameter(reverbAU, kAudioUnitScope_Global, 0, kReverb2Param_DecayTimeAt0Hz, 5.f, 0);
// set the decay time at Nyquist to 2.5 seconds
AudioUnitSetParameter(reverbAU, kAudioUnitScope_Global, 0, kReverb2Param_DecayTimeAtNyquist, 5.f, 0);
You can find the parameters for the reverb unit (and all Apple-supplied Audio Units) in AudioUnit/AudioUnitParameters.h
(Reverb param enum is on line 521)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With