Skip to main content

AudioSink

Trait AudioSink 

Source
pub trait AudioSink: Send + Sync {
    // Required method
    fn frame(&self, frame: AudioFrame);
}
Expand description

Where a capture delivers its encoded frames: frame is called on the capture’s delivery thread, off the audio path, once per frame, in order. A closure Fn(AudioFrame) + Send + Sync is a sink. The sink may call the capture’s stop or start from inside frame; such a re-entrant call is detected by thread and never joins.

Required Methods§

Source

fn frame(&self, frame: AudioFrame)

Take one encoded frame; dropping it returns its buffer to the capture.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> AudioSink for F
where F: Fn(AudioFrame) + Send + Sync,