channel.data.len() = 2 * channel.pos

This commit is contained in:
Gwilym Kuiper 2021-10-29 14:24:47 +01:00
parent 5266e7a40c
commit 46b40c8e5b

View file

@ -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;