sonora
Library Listed
Automatic Gain Control 2 (AGC2) with RNN VAD for WebRTC Audio Processing
- Downloads
- 551,810
- Dependents
- 3
- Stars
- 99
- Forks
- 17
- Contributors
- 4
- Commits
- 282
- Latest release
- 0.3.0 ·
About
Pure Rust implementation of WebRTC audio processing, providing echo cancellation, noise suppression, and automatic gain control.
Ported from the WebRTC Native Code (M145) audio processing module, plus 15 later upstream fixes up to M156 (listed in cpp/NEWS).
Crates
| Crate | Description | Crates.io | Documentation |
|---|---|---|---|
sonora | Full audio processing pipeline | ||
sonora-ffi | C API (FFI) for integration with C/C++ projects | ||
sonora-aec3 | Echo Canceller 3 (AEC3) | ||
sonora-agc2 | Automatic Gain Control with RNN VAD | ||
sonora-ns | Noise Suppression | ||
sonora-common-audio | Audio DSP primitives (resamplers, filters) | ||
sonora-simd | SIMD operations (SSE2, AVX2, NEON) | ||
sonora-fft | FFT implementations (Ooura, PFFFT) |
Features
- Echo Cancellation (AEC3) -- adaptive filter-based echo canceller with delay estimation
- Noise Suppression -- Wiener filter-based noise reduction with voice activity detection
- Automatic Gain Control (AGC2) -- RNN VAD-based gain controller with limiter
- High-Pass Filter -- DC offset removal
- C API -- cbindgen-generated C header for FFI integration (via
sonora-ffi)
Upstream's neural residual echo estimator (marked experimental at M145) is not ported; see sonora-aec3.
Quick Start
Run the minimal echo cancellation demo:
Read the full README
cargo run -p sonora --example simple
More examples in crates/sonora/examples/:
| Example | Description | Command |
|---|---|---|
simple | Synthetic AEC round-trip | cargo run -p sonora --example simple |
karaoke | Mic loopback with echo cancellation | cargo run -p sonora --features examples --example karaoke |
recording | Record & process to WAV | cargo run -p sonora --features examples --example recording -- --duration 5 --ns --agc |
The karaoke and recording examples require the examples feature which pulls in cpal, hound, and other audio I/O dependencies. These examples are based on the tonarino/webrtc-audio-processing examples, ported from PortAudio to cpal.
Supported Platforms
| Platform | Architecture | SIMD Backend | CI Status |
|---|---|---|---|
| Linux (Ubuntu) | x86_64 | SSE2, AVX2 | Build, test, clippy, fmt, docs |
| macOS | ARM64 (Apple Silicon) | NEON | Build, test |
| Windows | x86_64 | SSE2, AVX2 | Build, test |
| Android | aarch64, armv7, x86_64, i686 | NEON / SSE2 | Build, test (via cross) |
| iOS | aarch64 | NEON | Build, test (via simulator) |
Runtime feature detection is used for AVX2 on x86_64. SSE2 is assumed available on all x86_64 targets. NEON is used on AArch64. A scalar fallback is provided for all other architectures.
C++ Integration
The C++ reference test suite (WebRTC M145 plus the same upstream fixes, 2400+ tests) is validated on Ubuntu x86_64 with the Rust backend linked through the sonora-ffi C API.
Benchmarks
Full pipeline processing a 10 ms frame with AEC3 + noise suppression + AGC2 enabled.
Measured on Apple M4 Max (NEON backend), Rust 1.85, -C target-cpu=native:
| Benchmark | Rust | C++ | Ratio |
|---|---|---|---|
| 16 kHz mono | 4.2 us | 4.0 us | 1.07x |
| 48 kHz mono | 13.3 us | 10.8 us | 1.24x |
See BENCHMARKS.md for per-component comparisons, profiling breakdown, and instructions for reproducing.
Development
This project uses cargo-make for task automation.
cargo install cargo-make
Quick start
cargo make ci # Format, lint, test, docs
cargo make bench # Rust pipeline benchmarks
cargo make check # Type-check all crates (including excluded)
cargo make clippy # Lint all crates (including excluded)
C++ comparison (optional)
cargo make setup # Install system deps + build C++ library
cargo make cpp-bench # Run Rust vs C++ comparison benchmarks
cargo make cpp-test # Run comparison tests
cargo make cpp-validate # Run 2400+ C++ test suite with Rust backend
See Makefile.toml for the full list of tasks.
Minimum Supported Rust Version
The minimum supported Rust version is 1.91.
Related Projects
- tonarino/webrtc-audio-processing -- Rust bindings to the C++ WebRTC AudioProcessing module. Sonora's examples are based on theirs. If you need the battle-tested C++ implementation with a Rust wrapper, use tonarino; if you want a pure-Rust solution with no C++ dependency, use sonora.
- pulseaudio-wap -- The original extracted C++ code
History
Google's libwebrtc -- The original AudioProcessing module is developed as part of the WebRTC Native Code project at Google.
PulseAudio's webrtc-audio-processing -- Arun Raghavan and contributors extracted the AudioProcessing module into a standalone library with a Meson build system, making it usable outside of the full WebRTC stack. This packaging is used by PulseAudio, PipeWire, and other Linux audio projects.
M145 upgrade and test expansion -- The C++ codebase was updated to WebRTC M145 (branch-heads/7632), the full upstream test suite (2400+ tests) was ported, and the build was upgraded to C++20. (AI assisted)
Sonora:Rust port -- The C++ implementation was ported to pure Rust, producing this set of crates. The port includes the full SIMD (SSE2, AVX2, NEON) optimizations and the FFTs, as well as a C API for FFI integration. The full C++ test suite passes against this Rust version. (AI assisted)
License
All crates in this repository are licensed under BSD-3-Clause.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- BSD-3-Clause
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Automatic Gain Control 2 (AGC2) with RNN VAD for WebRTC Audio Processing |
551,810 downloads over 30 days | 3 | 99 | 0.3.0 | GPU support unknown | No native code found | BSD-3-Clause |
|
Rust interface for the WebRTC Voice-Activity-Detction Module |
60,022 downloads over 30 days | 7 | 31 | 0.4.0 | GPU support unknown | Build uses a native toolchain: cc | MIT |
|
any-tts Listed
A Rust TTS library with Candle backends and runtime adapters for modern open TTS models |
3,404 downloads over 30 days | 2 | 23 | 0.2.0 | CUDA, Metal | No native code found | Apache-2.0 OR MIT |
|
silero Listed
Production-oriented Rust wrapper for the Silero VAD ONNX model. |
1,888 downloads over 30 days | 3 | 6 | 0.7.0 | CUDA, ROCm | Binds native code: ort-sys (feature coreml) | Apache-2.0 OR MIT |
|
scribble Listed
High-level Rust API for audio transcription using Whisper |
457 downloads over 30 days | 0 | 105 | 0.5.4 | CUDA, Metal, Vulkan | Binds native code: whisper-rs-sys | MIT |
|
Voice for the Linux desktop: dictation, read-aloud (TTS), and voice-driven LLM commands, with Groq, OpenAI, Deepgram, and local Whisper backends |
61 binary downloads per release | Not applicable | 149 | 0.2.0 | CUDA, Vulkan | Binds native code: alsa-sys, mac-notification-sys, wayland-sys (feature overlay), whisper-rs-sys (feature local-whisper) | MIT |
|
voxr New
Audio and speech on boostr: compressed-audio decode, resampling, DSP and grapheme to phoneme, with speech synthesis (Kokoro, VITS), voice cloning (VoxCPM2), transcription with word timings (Whisper), voice activity (Silero) and audio-text scoring (CLAP), on CPU or CUDA. |
642 downloads over 30 days | 2 | 2 | 0.9.1 | CUDA | No native code found | Apache-2.0 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 2 active dependents and 2 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route does not pass: the repo's main crate sonora is not in this entry.
What else the check found
- The last activity is on 7 Nov 2026, 2 days ago. The rules expect an update within 365 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.3.0 base 80, doubled for 551810 downloads per month, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-11-07, 2 days ago, E = 365: activefeatured: not featured: active_users 2 < 11 and new_adopters 2 < 9 and repository route: the repo's main crate sonora is not in this entrylisted: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption2 active dependents, 2 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 2 | crates.io database dump | Yes | |
| New dependents (365 days) | 2 | crates.io database dump | Yes | |
| Peak active dependents | 2 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 2 days ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-11-07 | GitHub repository | Yes | |
| Latest release | 2026-11-07 | crates.io database dump | Yes | |
| First release | 2026-02-11 | crates.io database dump | Yes | |
| Latest version | 0.3.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 0 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 5 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution3 releases, 551,810 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 3 | crates.io database dump | Yes | |
| Downloads over 30 days | 551810 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository99 stars, 17 forks, 4 contributors, 282 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 99 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 17 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 4 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 282 | GitHub repository | No | |
| Repository's main crate left out of the entry | sonora | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | BSD-3-Clause | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 3 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.