ReverbAudioSource parameters

Hi there,

I’m wishing to customise the parameters of a ReverbAudioSource object that I’ve implemented to route through to an AudioMixerSource object - to add some reverb to my Synthesiser.

I’ve declared my ReverbAudioSource and Parameters objects as shown here -

ReverbAudioSource reverbSource;

Reverb::Parameters& customParameters;

I’m able to customise the parameters, before passing this Parameters object to the ReverbAudioSource.

However, I’m met with the following error -

Constructor for 'MainContentComponent' must explicitly initialize the reference member 'customParameters'

I’m not sure on how to initialise the Parameters object, would someone be able to advise me?

Thanks !

You defined your member as a reference, which means it references a Parameter object that exists somewhere else. A reference must cannot be empty, so the compiler refuses to create an instance of MainContentComponent without setting the reference.

I think in your case you actually wanted to use an actual Reverb::Parameters object, so the solution is to remove the &.
The values of that struct are copied into the Reverb, even though the argument is a const reference. That was chosen so the struct doesn’t need to be copied.

That works, thanks a lot!