From 8947d3ccc619543e01363a9d80e8f1d88ee5a93a Mon Sep 17 00:00:00 2001 From: arbipink Date: Fri, 3 Apr 2026 06:24:14 +0700 Subject: [PATCH] Change 1.0f to env->sustainLevel in case the user release the spacebar before attack state done --- examples/audio/audio_amp_envelope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;