Skip to main content

AudioSource

Trait AudioSource 

Source
pub trait AudioSource {
    // Required methods
    fn format(&self) -> PcmFormat;
    fn read<'b>(&mut self, out: &'b mut [u8]) -> Result<PcmBlock<'b>>;
}
Expand description

Produces fixed-size blocks of PCM into caller memory.

Required Methods§

Source

fn format(&self) -> PcmFormat

Rate, channels and encoding of every block this source produces.

Source

fn read<'b>(&mut self, out: &'b mut [u8]) -> Result<PcmBlock<'b>>

Fill out completely (it must be a whole number of frames) and return the block over it, stamped with the capture time of its first frame.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§