If volume is 0, don't actually play anything

This commit is contained in:
Gwilym Kuiper 2023-01-12 21:54:08 +00:00
parent 6ebe08e528
commit 8009ffea09

View file

@ -446,6 +446,7 @@ impl MixerBuffer {
} }
} }
if channel.volume != 0.into() {
if channel.is_stereo { if channel.is_stereo {
unsafe { unsafe {
agb_rs__mixer_add_stereo( agb_rs__mixer_add_stereo(
@ -468,6 +469,7 @@ impl MixerBuffer {
); );
} }
} }
}
channel.pos += playback_speed * self.frequency.buffer_size(); channel.pos += playback_speed * self.frequency.buffer_size();
} }