pub(crate) struct InputConverter {
channels: usize,
resampling: Option<Resampling>,
}Expand description
Turns what the device delivers into the mono SAMPLE_RATE signal
everything downstream reads. Pass-through when the device natively
offers the model rate; otherwise downmix to mono, then resample
with a windowed-sinc filter. Decimating without the filter would
fold everything above the new Nyquist into the speech band as
confident wrong words.
Built on the recorder thread and moved into the stream callback,
which is FnMut, so push is the whole realtime path: it extends
preallocated buffers and hands the samples on as they are ready.
Fields§
§channels: usize§resampling: Option<Resampling>Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for InputConverter
impl !Sync for InputConverter
impl !UnwindSafe for InputConverter
impl Freeze for InputConverter
impl Send for InputConverter
impl Unpin for InputConverter
impl UnsafeUnpin for InputConverter
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