diff options
-rw-r--r-- | Alc/alcEcho.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index 68549fde..35b94a90 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -105,7 +105,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff { ALechoState *state = (ALechoState*)effect; ALuint frequency = Context->Device->Frequency; - ALfloat lrpan, cw, a, g; + ALfloat lrpan, cw, g; state->Tap[0].delay = (ALuint)(Effect->Echo.Delay * frequency) + 1; state->Tap[1].delay = (ALuint)(Effect->Echo.LRDelay * frequency); @@ -119,10 +119,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff cw = cos(2.0*M_PI * LOWPASSFREQCUTOFF / frequency); g = 1.0f - Effect->Echo.Damping; - a = 0.0f; - if(g < 0.9999f) // 1-epsilon - a = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / (1 - g); - state->iirFilter.coeff = a; + state->iirFilter.coeff = lpCoeffCalc(g, cw); } static ALvoid EchoProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) |