Skip to main content

StartupSamples

Struct StartupSamples 

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

One generation’s leading microphone validation, before DSP or gain. Confirm 10 ms of valid native frames and replay them from the beginning.

Implementations§

Source§

impl StartupSamples

Source

pub fn new(rate: u32, channels: u16) -> Self

Create state for a validated nonzero mono/stereo native format.

Source

pub fn is_pending(&self) -> bool

Whether this generation is still validating its leading samples.

Source

pub fn dropped_frames(&self) -> u64

Number of suppressed native frames, including interrupted confirmation windows.

Source

pub fn dropped_event(&self) -> Option<Event>

The single report for this generation, also usable on timeout/early shutdown.

Source

pub fn check_deadline(&self, elapsed: Duration) -> Result<()>

Reject persistent invalid startup at the wall-clock deadline, even without more input.

Source

pub fn finish(&mut self) -> StartupOutput<'static>

Finish a generation. A wholly valid short input is released unchanged; an unconfirmed candidate following invalid input is suppressed and counted.

Source

pub fn push<'a>( &mut self, samples: &'a [f32], elapsed: Duration, ) -> Result<StartupOutput<'a>>

Feed whole native frames off callback. Mid-stream samples are never modified.

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.