pub trait Mixer {
// Required methods
fn play(&mut self, sound: &Sound, params: PlayParams) -> Option<Channel>;
fn stop(&mut self, channel: Channel);
fn set_volume(&mut self, channel: Channel, volume: f32);
}Expand description
What the scene needs from the channel pool (implemented by crate::Device).
Required Methods§
Sourcefn play(&mut self, sound: &Sound, params: PlayParams) -> Option<Channel>
fn play(&mut self, sound: &Sound, params: PlayParams) -> Option<Channel>
Start a sound on a free channel, or return None when no channel is free.
Sourcefn set_volume(&mut self, channel: Channel, volume: f32)
fn set_volume(&mut self, channel: Channel, volume: f32)
Change a channel’s volume.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".