From 46b40c8e5bd602d7bf4debbe654339cb68df3297 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Fri, 29 Oct 2021 14:24:47 +0100 Subject: [PATCH] channel.data.len() = 2 * channel.pos --- agb/src/sound/mixer/sw_mixer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agb/src/sound/mixer/sw_mixer.rs b/agb/src/sound/mixer/sw_mixer.rs index 00a1f56b..5b7e9406 100644 --- a/agb/src/sound/mixer/sw_mixer.rs +++ b/agb/src/sound/mixer/sw_mixer.rs @@ -147,7 +147,7 @@ impl MixerBuffer { if (channel.pos + playback_speed * SOUND_BUFFER_SIZE).floor() >= channel.data.len() { // TODO: This should probably play what's left rather than skip the last bit if channel.should_loop { - channel.pos -= channel.data.len(); + channel.pos = 0.into(); } else { channel.is_done = true; continue;