Skip to main content

Output

Struct Output 

Source
pub struct Output { /* private fields */ }
Expand description

The stream’s samples to their sink.

Implementations§

Source§

impl Output

Source

pub fn open(sink: &Sink, channels: u16, rate: u32) -> Result<Self>

Opens sink for channels channels at rate hertz.

Source

pub fn write(&self, samples: &[f32], presented: Option<Presented>)

Takes interleaved frames, and when they are due where the stream says.

Source

pub fn playout(&self) -> Option<(i64, i64)>

How long after its presentation time each sample plays, once the output knows, and how far from that the last chunk played, in nanoseconds.

Source

pub fn drift_ppm(&self) -> i32

How far the device’s clock runs from the stream’s, in parts per million, as the resampler follows it.

Source

pub fn underruns(&self) -> u64

Times the device found nothing to play.

Source

pub fn take_peak(&self) -> f32

The loudest sample since the last call, from 0 to 1.

Auto Trait Implementations§

§

impl !Freeze for Output

§

impl !RefUnwindSafe for Output

§

impl !UnwindSafe for Output

§

impl Forget for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnsafeUnpin for Output

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.