Skip to main content

Mixer

Struct Mixer 

Source
pub struct Mixer { /* private fields */ }

Implementations§

Source§

impl Mixer

Source

pub fn new(rate: u32, channels: u16) -> Self

Source

pub fn rate(&self) -> u32

Source

pub fn channels(&self) -> u16

Source

pub fn clock(&self) -> u64

Source

pub fn set_seed(&mut self, seed: u64)

Source

pub fn set_master_volume(&mut self, volume: f32)

Source

pub fn set_master_muted(&mut self, muted: bool)

Source

pub fn master_volume(&self) -> f32

Source

pub fn master_muted(&self) -> bool

Source

pub fn set_limiter(&mut self, threshold: Option<f32>)

Source

pub fn limiter(&self) -> Option<f32>

Source

pub fn set_channel_volume(&mut self, channel: ChannelId, volume: f32)

Source

pub fn set_channel_muted(&mut self, channel: ChannelId, muted: bool)

Source

pub fn channel_volume(&self, channel: ChannelId) -> f32

Source

pub fn channel_gain(&self, channel: ChannelId) -> f32

Source

pub fn master_gain(&self) -> f32

Source

pub fn channel_muted(&self, channel: ChannelId) -> bool

Source

pub fn set_channel_pitch(&mut self, channel: ChannelId, ratio: f32)

Source

pub fn glide_channel_pitch( &mut self, channel: ChannelId, ratio: f32, seconds: f32, )

Source

pub fn channel_pitch(&self, channel: ChannelId) -> f32

Source

pub fn set_channel_lowpass(&mut self, channel: ChannelId, hz: Option<f32>)

Source

pub fn set_channel_highpass(&mut self, channel: ChannelId, hz: Option<f32>)

Source

pub fn glide_channel_lowpass( &mut self, channel: ChannelId, hz: Option<f32>, seconds: f32, )

Source

pub fn glide_channel_highpass( &mut self, channel: ChannelId, hz: Option<f32>, seconds: f32, )

Source

pub fn channel_lowpass(&self, channel: ChannelId) -> Option<f32>

Source

pub fn channel_highpass(&self, channel: ChannelId) -> Option<f32>

Source

pub fn set_ducking(&mut self, ducking: Option<Ducking>)

Source

pub fn ducking(&self) -> Option<Ducking>

Source

pub fn ducked_db(&self) -> f32

Source

pub fn play(&mut self, clip: &Clip, level: Level) -> VoiceId

Source

pub fn play_at(&mut self, at: u64, clip: &Clip, level: Level) -> VoiceId

Source

pub fn play_on( &mut self, channel: ChannelId, clip: &Clip, level: Level, ) -> VoiceId

Source

pub fn play_at_on( &mut self, channel: ChannelId, at: u64, clip: &Clip, level: Level, ) -> VoiceId

Source

pub fn play_music( &mut self, track: &MusicTrack, fade_seconds: f32, level: Level, ) -> VoiceId

Source

pub fn stop_music(&mut self, fade_seconds: f32)

Source

pub fn music(&self) -> Option<VoiceId>

Source

pub fn music_position(&self) -> Option<f64>

Source

pub fn stop(&mut self, id: VoiceId, fade_seconds: f32)

Source

pub fn set_volume(&mut self, id: VoiceId, volume: f32)

Source

pub fn set_pan(&mut self, id: VoiceId, pan: f32)

Source

pub fn set_pitch(&mut self, id: VoiceId, ratio: f32)

Source

pub fn glide_pitch(&mut self, id: VoiceId, ratio: f32, seconds: f32)

Source

pub fn pitch(&self, id: VoiceId) -> Option<f32>

Source

pub fn set_resample(&mut self, id: VoiceId, resample: Resample)

Source

pub fn set_gain(&mut self, id: VoiceId, gain: f32)

Source

pub fn glide_gain(&mut self, id: VoiceId, gain: f32, seconds: f32)

Source

pub fn tone( &mut self, channel: ChannelId, wave: Wave, hz: f32, volume: f32, ) -> VoiceId

Source

pub fn tone_in( &mut self, offset: u64, channel: ChannelId, wave: Wave, hz: f32, volume: f32, ) -> VoiceId

Source

pub fn set_envelope(&mut self, id: VoiceId, envelope: Option<Envelope>)

Source

pub fn envelope_level(&self, id: VoiceId) -> Option<f32>

Source

pub fn pcm_stream( &mut self, channel: ChannelId, channels: u16, capacity_seconds: f32, level: Level, ) -> (VoiceId, PcmSender)

Source

pub fn set_tone_frequency(&mut self, id: VoiceId, hz: f32)

Source

pub fn glide_tone_frequency(&mut self, id: VoiceId, hz: f32, seconds: f32)

Source

pub fn sound(&mut self, clip: &Clip, spec: SoundSpec) -> SoundId

Source

pub fn tone_sound( &mut self, wave: Wave, hz: f32, seconds: Option<f32>, spec: SoundSpec, ) -> SoundId

Source

pub fn trigger(&mut self, sound: SoundId) -> Option<VoiceId>

Source

pub fn trigger_in(&mut self, offset: u64, sound: SoundId) -> Option<VoiceId>

Source

pub fn trigger_at(&mut self, at: u64, sound: SoundId) -> Option<VoiceId>

Source

pub fn trigger_with(&mut self, sound: SoundId, volume: f32) -> Option<VoiceId>

Source

pub fn trigger_in_with( &mut self, offset: u64, sound: SoundId, volume: f32, ) -> Option<VoiceId>

Source

pub fn trigger_at_with( &mut self, at: u64, sound: SoundId, volume: f32, ) -> Option<VoiceId>

Source

pub fn voices_of(&self, sound: SoundId) -> usize

Source

pub fn voice_count(&self) -> usize

Source

pub fn render(&mut self, frames: usize) -> Vec<f32>

Source

pub fn render_into(&mut self, out: &mut [f32])

Source§

impl Mixer

Source

pub fn stream_vorbis( &mut self, channel: ChannelId, source: &VorbisSource, looping: Option<(u64, u64)>, level: Level, ) -> Result<VoiceId, String>

Source

pub fn play_music_vorbis( &mut self, source: &VorbisSource, looping: Option<(u64, u64)>, fade_seconds: f32, level: Level, ) -> Result<VoiceId, String>

Auto Trait Implementations§

§

impl Freeze for Mixer

§

impl RefUnwindSafe for Mixer

§

impl Send for Mixer

§

impl Sync for Mixer

§

impl Unpin for Mixer

§

impl UnsafeUnpin for Mixer

§

impl UnwindSafe for Mixer

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,