diff --git a/src/denoise.c b/src/denoise.c index 1216c255..de82dd5f 100644 --- a/src/denoise.c +++ b/src/denoise.c @@ -546,11 +546,10 @@ float rnnoise_process_frame(DenoiseState *st, float *out, const float *in) { if (min < st->max_attenuation) { if (min < MIN_MAX_ATTENUATION) min = MIN_MAX_ATTENUATION; - mult = st->max_attenuation / min; + mult = (1.0f-st->max_attenuation) / (1.0f-min); for (i=0;i 1) g[i] = 1; + g[i] = 1.0f-((1.0f-g[i]) * mult); st->lastg[i] = g[i]; } }