Skip to main content

Mixer

Trait Mixer 

Source
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§

Source

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.

Source

fn stop(&mut self, channel: Channel)

Stop a channel.

Source

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".

Implementors§