diff --git a/agb/src/sound/mixer/sw_mixer.rs b/agb/src/sound/mixer/sw_mixer.rs index aef9acfe..755025b0 100644 --- a/agb/src/sound/mixer/sw_mixer.rs +++ b/agb/src/sound/mixer/sw_mixer.rs @@ -62,6 +62,16 @@ impl Mixer { panic!("Cannot play more than 16 sounds at once"); } + + pub fn get_channel(&mut self, id: ChannelId) -> Option<&'_ mut SoundChannel> { + if let Some(channel) = &mut self.channels[id.0] { + if self.indices[id.0] == id.1 { + return Some(channel); + } + } + + None + } } // I've picked one frequency that works nicely. But there are others that work nicely