diff --git a/examples/audio/audio_amp_envelope.c b/examples/audio/audio_amp_envelope.c index 4f40c09d5..9d6939e35 100644 --- a/examples/audio/audio_amp_envelope.c +++ b/examples/audio/audio_amp_envelope.c @@ -194,7 +194,7 @@ static void UpdateEnvelope(Envelope *env) break; case RELEASE: - env->currentValue -= (1.0f / env->releaseTime) * sampleTime; + env->currentValue -= (env->sustainLevel / env->releaseTime) * sampleTime; if (env->currentValue <= 0.001f) // Use a small threshold to avoid infinite tail { env->currentValue = 0.0f;