pub struct Preprocessor { /* private fields */ }Expand description
Audio preprocessor that applies configured processing stages.
Each instance maintains its own filter state, so you should create
one Preprocessor per audio stream (or per VAD config in vad-lab).
§Processing Order
- High-pass filter (removes low-frequency noise)
- Noise suppression (RNNoise, resamples internally if not 48kHz)
- Normalization (RMS-based amplitude adjustment)
Implementations§
Source§impl Preprocessor
impl Preprocessor
Sourcepub fn new(config: &PreprocessorConfig, sample_rate: u32) -> Self
pub fn new(config: &PreprocessorConfig, sample_rate: u32) -> Self
Create a new preprocessor with the given configuration.
§Arguments
config- Preprocessing configurationsample_rate- Audio sample rate in Hz
Sourcepub fn sample_rate(&self) -> u32
pub fn sample_rate(&self) -> u32
Returns the sample rate this preprocessor was configured for.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true if any preprocessing stages are enabled.
Sourcepub fn is_denoising(&self) -> bool
pub fn is_denoising(&self) -> bool
Returns true if noise suppression is active.
Sourcepub fn is_normalizing(&self) -> bool
pub fn is_normalizing(&self) -> bool
Returns true if normalization is active.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Preprocessor
impl !RefUnwindSafe for Preprocessor
impl Send for Preprocessor
impl Sync for Preprocessor
impl Unpin for Preprocessor
impl UnsafeUnpin for Preprocessor
impl !UnwindSafe for Preprocessor
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