Skip to main content

PcmSource

Trait PcmSource 

Source
pub trait PcmSource {
    // Required methods
    fn spec(&self) -> &PcmSpec;
    fn read_buffer(&mut self) -> Result<Option<PcmBuffer>>;
}
Expand description

Pull source of PCM audio buffers in a fixed PcmSpec.

Implementors yield PcmBuffers until exhausted. Every buffer a source produces is expected to match the source’s spec.

Required Methods§

Source

fn spec(&self) -> &PcmSpec

Returns the audio format every buffer from this source uses.

Source

fn read_buffer(&mut self) -> Result<Option<PcmBuffer>>

Reads the next buffer, or Ok(None) once the source is drained.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§