Skip to main content

Mixer

Struct Mixer 

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

The audio thread’s half of the mixer. See the module documentation.

Implementations§

Source§

impl Mixer

Source

pub fn physical_voices(&self) -> usize

Latest snapshot of selected, unpaused physical voices, including audible tails.

Source

pub fn virtual_voice_count(&self) -> usize

Latest snapshot of advancing virtual voices; paused voices are separate.

Source§

impl Mixer

Source

pub fn new(config: MixerConfig) -> Result<(Mixer, MixerHandle)>

Source

pub fn sample_rate(&self) -> u32

Source

pub fn channels(&self) -> usize

Source

pub fn frame(&self) -> u64

Frames rendered so far.

Source

pub fn active_voices(&self) -> usize

All retained voices, including virtual, paused and fading-out voices.

Source

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

Renders the next out.len() / channels frames into the interleaved out. Allocates nothing, takes no lock and does not block.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Mixer

§

impl !Sync for Mixer

§

impl !UnwindSafe for Mixer

§

impl Freeze for Mixer

§

impl Send for Mixer

§

impl Unpin for Mixer

§

impl UnsafeUnpin 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.

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.

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.