diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 4748887e3..f0be05ed6 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -1282,6 +1282,11 @@ bool Effect::Process() CopyInputTracks(Track::All); bool bGoodResult = true; + // It's possible that the number of channels the effect expects changed based on + // the parameters (the Audacity Reverb effect does when the stereo width is 0). + mNumAudioIn = GetAudioInCount(); + mNumAudioOut = GetAudioOutCount(); + mPass = 1; if (InitPass1()) { diff --git a/src/effects/Reverb.cpp b/src/effects/Reverb.cpp index ece77c13b..e026aeca4 100644 --- a/src/effects/Reverb.cpp +++ b/src/effects/Reverb.cpp @@ -151,12 +151,12 @@ EffectType EffectReverb::GetType() int EffectReverb::GetAudioInCount() { - return 2; + return mParams.mStereoWidth ? 2 : 1; } int EffectReverb::GetAudioOutCount() { - return 2; + return mParams.mStereoWidth ? 2 : 1; } #define BLOCK 16384 @@ -230,7 +230,7 @@ sampleCount EffectReverb::ProcessBlock(float **inBlock, float **outBlock, sample reverb_process(&mP[c].reverb, len); } - if (mNumChans == 2 && mParams.mStereoWidth) + if (mNumChans == 2) { for (sampleCount i = 0; i < len; i++) {