How to set reverb level and time to kAudioUnitSubType_Reverb2

I managed to add a reverb block to my graph, something like this:

AudioComponentDescription auEffectUnitDescription; auEffectUnitDescription.componentType = kAudioUnitType_Effect; auEffectUnitDescription.componentSubType = kAudioUnitSubType_Reverb2; auEffectUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple; AUGraphAddNode( processingGraph, &auEffectUnitDescription, &auEffectNode), 

Now, how can I change some parameters on the reverb block? I would like to change the wet / dry ratio and reduce the decay time.

+6
source share
1 answer

First, you need to get a link to the real sound reverb block:

 AudioUnit reverbAU = NULL; AUGraphNodeInfo(processingGraph, auEffectNode, NULL, &reverbAU); 

Now that you have an Audio Unit, you can set parameters on it, for example

 // 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 block (and all audio devices supplied by Apple) in AudioUnit/AudioUnitParameters.h (the param reverb parameter is on line 521)

+15
source

Source: https://habr.com/ru/post/909762/


All Articles