pub enum CaptureSource {
Microphone(MicCapture),
File(FakeMic),
}Expand description
Unified capture source: either a live microphone or a file-fed FakeMic.
Variants§
Microphone(MicCapture)
File(FakeMic)
Implementations§
Source§impl CaptureSource
impl CaptureSource
Sourcepub fn pop_samples(&self, buf: &mut [f32]) -> usize
pub fn pop_samples(&self, buf: &mut [f32]) -> usize
Drain up to buf.len() 16 kHz mono samples. Returns the count actually read.
Sourcepub fn is_file_done(&self) -> bool
pub fn is_file_done(&self) -> bool
Returns true when a File source’s feeder thread has finished and the
ring buffer is empty. Always false for a live Microphone source.
pub fn native_sample_rate(&self) -> u32
pub fn native_channels(&self) -> u16
Sourcepub fn dropped_samples(&self) -> u64
pub fn dropped_samples(&self) -> u64
Cumulative samples dropped due to a full downstream ring. Always 0 for file sources. A growing value means the consumer (decoder) can’t keep up with real-time audio.
Auto Trait Implementations§
impl !RefUnwindSafe for CaptureSource
impl !Send for CaptureSource
impl !Sync for CaptureSource
impl !UnwindSafe for CaptureSource
impl Freeze for CaptureSource
impl Unpin for CaptureSource
impl UnsafeUnpin for CaptureSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more