logo

Trait fon::Sink

source · []
pub trait Sink<Chan: Channel, const CH: usize>: Debug {
    fn sample_rate(&self) -> NonZeroU32;
fn len(&self) -> usize;
fn sink_with(&mut self, iter: &mut dyn Iterator<Item = Frame<Chan, CH>>); fn is_empty(&self) -> bool { ... } }
Expand description

Audio sink - a type that consumes audio samples.

Required methods

Get the sample rate of the sink in hertz.

Get the length of the sink in frames.

Sinks must always have finite length.

Sink audio samples from a frame iterator.

Warning: if used incorrectly, this method may introduce audio aliasing. To avoid that, make sure the sample rate of the frames from the iterator matches exactly the sample rate of the sink.

Provided methods

Check if the sink is empty (length of zero).

Implementors