Skip to main content

PcmSink

Trait PcmSink 

Source
pub trait PcmSink {
    // Required methods
    fn spec(&self) -> &PcmSpec;
    fn write_buffer(&mut self, buffer: PcmBuffer) -> Result<()>;
    fn flush(&mut self) -> Result<()>;
}
Expand description

Push sink for PCM audio buffers in a fixed PcmSpec.

Implementors accept PcmBuffers that match their spec and signal end-of-stream through flush.

Required Methods§

Source

fn spec(&self) -> &PcmSpec

Returns the audio format this sink accepts.

Source

fn write_buffer(&mut self, buffer: PcmBuffer) -> Result<()>

Writes one buffer to the sink.

Returns an error when the buffer’s spec does not match the sink’s spec.

Source

fn flush(&mut self) -> Result<()>

Flushes any pending output, marking a stream boundary.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§