1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Audio processing utilities.
//!
//! - `resamplers` — streaming sample-rate conversion (pure Rust, via `rubato`)
//! - `noisefilter` — RNNoise-based noise suppression (pure Rust, via `nnnoiseless`)
//! - `hushfilter` — DeepFilterNet3-style suppression (pure Rust, via `hush-vani`)
//! - `agc` — high-pass filter, automatic gain control, and soft limiter
/// A streaming noise-suppression filter over PCM i16 audio.
///
/// Both [`RNNoiseFilter`](noisefilter::RNNoiseFilter) and
/// [`HushVaniFilter`](hushfilter::HushVaniFilter) implement this, so the STT
/// path can select a backend at runtime behind a single `Box<dyn>`.
///
/// Contract: over a full utterance the total output length is approximately the
/// total input length. Any individual [`filter`](Self::filter) call may return
/// fewer (or zero) samples because of internal frame buffering / algorithmic
/// latency. Call [`flush`](Self::flush) at end-of-utterance to drain the tail,
/// and [`reset`](Self::reset) to clear state before the next utterance.
use RNNoiseFilter;