Skip to content

Commit

Permalink
fix for stopping samples with envelopes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stevesims committed Nov 23, 2024
1 parent a8d821c commit 2bb6e8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion video/audio_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down

0 comments on commit 2bb6e8f

Please sign in to comment.