From 2bb6e8f28c5ad2fefbe787ee0882f8900789659b Mon Sep 17 00:00:00 2001 From: Steve Sims Date: Sat, 23 Nov 2024 11:58:45 +0000 Subject: [PATCH] fix for stopping samples with envelopes fixes an issue observed when attempting to stop the note on a channel playing a sample that has a volume envelope set would cause the note to abruptly stop, rather than allowing the release phase of the envelope to happen --- video/audio_channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/audio_channel.h b/video/audio_channel.h index 15fe97c7..b87c2a2f 100644 --- a/video/audio_channel.h +++ b/video/audio_channel.h @@ -273,7 +273,7 @@ uint8_t AudioChannel::setVolume(uint8_t volume) { break; case AudioState::PlayLoop: // we are looping, so an envelope may be active - if (volume == 0 && this->_waveformType != AUDIO_WAVE_SAMPLE) { + if (volume == 0) { // silence whilst looping always stops playback - curtail duration this->_duration = millis() - this->_startTime; // if there's a volume envelope, just allow release to happen, otherwise...