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
46
47
48
49
50
51
52
53
//! Audio enhancement (echo cancellation, noise suppression, gain control,
//! voice activity detection) — thin Mediaway-typed adapter over the pure-Rust
//! [`sonora`](https://crates.io/crates/sonora) WebRTC Audio Processing port.
//!
//! Meant to sit right after microphone capture
//! (`mediaway_device::AudioCapture::poll_frame`), before anything else
//! touches the signal — **not** a hook on `mediaway::EncodeSession`,
//! which has no audio track support today. See
//! `adr/0001-sonora-audio-processing-adoption.md` for the full design
//! rationale: license verdict, crate placement, the `AudioProcessor` /
//! `VoiceActivityDetector` render/capture push·poll shape (deliberately
//! **not** a `FrameFilter`-parallel single-stream trait), the panic-safety
//! posture, and the VAD i16-scale integration caveat.
//!
//! [`AudioProcessor`] (`apm` feature — AEC3 + NS + AGC2, via
//! `sonora::AudioProcessing`) and [`VoiceActivityDetector`] (`vad` feature —
//! RNN VAD, via `sonora_agc2::vad_wrapper`) are independent, concrete types,
//! each usable standalone. Both catch `sonora`/`sonora-agc2` panics and
//! permanently disable the offending instance rather than propagate — see
//! `is_disabled()` on each type and [`ApmError::BackendPanicked`].
// crate-root doc became module doc (ADR-0021 merge)
pub use ApmError;
pub use ;
pub use VoiceActivityDetector;
/// `sonora`'s top-level processing configuration — passed to
/// [`AudioProcessor::open`]. All components (echo canceller, noise
/// suppression, gain controller, …) are disabled (`None`) by default;
/// enable them via the [`config`] module's types, e.g.
/// `ApmConfig { echo_canceller: Some(config::EchoCanceller::default()), ..Default::default() }`.
pub use Config as ApmConfig;
/// Re-export of `sonora`'s processing configuration module
/// (`EchoCanceller`, `NoiseSuppression`, `GainController2`, …) — construct
/// an [`ApmConfig`] using these types directly. This crate defines no
/// parallel config surface of its own; see
/// `adr/0001-sonora-audio-processing-adoption.md` § 3 for why (thin adapter,
/// not a custom abstraction over `sonora`).
pub use config;