Skip to main content

Input

Struct Input 

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

The stream’s samples from its source.

Implementations§

Source§

impl Input

Source

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

Opens source for channels channels at rate hertz.

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 counts(&self) -> (u64, u64)

Times frames were dropped as the device ran too far ahead, and reads while it had none.

Source

pub fn read(&mut self, out: &mut [f32])

Fills out with interleaved frames.

Source

pub fn read_as(&mut self, out: &mut [f32], channels: usize)

Fills out with interleaved frames of channels, as a stream of other channels than its source takes them: the source’s from the first, silence past them, and those past channels left out.

Source

pub fn skip(&mut self, frames: usize)

Leaves out the next frames frames, as for frames too late to send, so those after come when they would have.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Input

§

impl !UnwindSafe for Input

§

impl Forget for Input

§

impl Freeze for Input

§

impl Move for Input

§

impl Send for Input

§

impl Sync for Input

§

impl Unpin for Input

§

impl UnsafeUnpin for Input

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.