Crossfading smoothly between AudioSources

is there something in Juce that makes it easy to crossfade between 2 AudioSources, and then stop processing the unneeded one when the crossfade is complete?

In my case, I have a bank of effects that need to be changed in realtime, with smooth glitch-free changes, so am looking for ~5ms crossfades as the new effect is faded in, and the old one faded out.

I guess i can write my own Crossfader class, but just wondering if this has already been done, so maybe i don’t have to re-invent the wheel?

Take a look at the LinearSmoothedValue class. It should be in the effects folder of the juce_audio_basics module.

If you need an exponentially smoothed value I made a small class based on the same interface:

1 Like