denoize
The pursuit of the world's highest-fidelity audio denoising — in pure Rust.
denoize removes background noise from WAV recordings with maximum transparency:
preserving timbre, transients, dynamics, stereo imaging, and natural "air".
Implemented technology stack
Classical DSP (always available)
- STFT/ISTFT + Perfect Reconstruction OLA + high overlap
- IMCRA/MCRA noise estimation + SPP + spectral-flatness profiling
- Ephraim-Malah Decision-Directed SNR
- 8 gain estimators: OMLSA, LogMMSE, MMSE-STSA, Wiener, SpecSub, SpecSub-NL, SpecSub-Geo
- Transient protection, cepstral smoothing, pre-emphasis
- Advanced windows: Kaiser, Flat-top, DPSS (+ Hann/Hamming/Sine/Blackman)
- Multiband spectral subtraction (Bark bands)
- Perceptual weighting (Bark-scale gain shaping)
- Musical-noise post-filter
Optional AI backends (feature-gated)
| Backend | Feature | Description |
|---|---|---|
rnnoise |
--features rnnoise |
RNNoise via nnnoiseless (pure-Rust) |
deepfilter |
--features deepfilter |
DeepFilterNet v3 (tract ONNX, embedded model) |
onnx |
--features onnx |
External waveform-to-waveform ONNX model (tract, Pure Rust) |
mpsenet |
--features mpsenet |
MP-SENet magnitude/phase enhancement adapter (external converted model) |
bsrnn |
--features bsrnn |
ESPnet BSRNN spectral enhancement adapter (external converted model) |
mossformer2 |
--features mossformer2 |
ClearerVoice MossFormer2 48 kHz mask adapter (external converted model) |
sgmse |
--features sgmse |
SGMSE+ iterative diffusion adapter (external converted model) |
gtcrn |
--features gtcrn |
Official 48K-parameter causal GTCRN; offline and stateful streaming |
Build everything: cargo build --release --features full
The generic ONNX backend is the deployment foundation for future neural models. It intentionally accepts only single-input/single-output waveform models; spectral models and diffusion samplers require dedicated adapters.
The prebuilt GitHub binaries include every backend. Because DeepFilterNet 0.5.6 is not available from crates.io, the crates.io package's
fullfeature currently includes RNNoise, generic ONNX, MP-SENet, BSRNN, MossFormer2, and SGMSE+, but not DeepFilterNet.
Supported input formats
| Format | Decoder | Notes |
|---|---|---|
| WAV | hound |
8–32 bit int / float |
| MP3 | nanomp3 (Pure Rust) |
ID3 skip, no resampling |
| M4A/AAC | oxideav-aac (Pure Rust) |
MP4 demux + AAC-LC decode |
| FLAC | claxon |
Lossless FLAC |
| Ogg Opus | opus + ogg |
Mono/stereo; native 48 kHz decode |
Output formats
| Format | Encoder | Notes |
|---|---|---|
| WAV | hound |
Lossless; preserves bit depth |
| MP3 | shine-rs (Pure Rust) |
--mp3-bitrate (default 192 kbps) |
| M4A | oxideav-aac + MP4 mux |
GitHub/source builds; --m4a-bitrate (default 192 kbps) |
| FLAC | flacenc |
Lossless, pure Rust |
| Ogg Opus | opus + ogg |
128 kbps, mono/stereo |
# MP3 / M4A input and output — no manual ffmpeg conversion
# User-supplied waveform model: [1, samples] or [1, 1, samples]
# Official MP-SENet checkpoint converted with scripts/export-mpsenet.py
# ESPnet BSRNN xtiny checkpoint converted with scripts/export-bsrnn.py
# ClearerVoice MossFormer2 48 kHz model
# Official SGMSE+ VoiceBank model (30-step quality sampler)
# Verified official GTCRN model (manual model path is unnecessary afterwards)
# Stereo coupling, pipes, metrics, and directory batches
|
To prepare the pinned official MP-SENet VoiceBank model:
The VoiceBank graph is about 9 MiB and expects 16 kHz audio. On the reference x86-64 Linux host, a two-second mono speech fixture took 43.67 seconds after model loading and the complete process used 410,048 KiB maximum RSS. Run the pinned real-speech quality gate after conversion:
To prepare the pinned ESPnet BSRNN xtiny model (CC-BY-4.0):
|
The adapter resamples to 48 kHz and reproduces the published model's variance normalization, centered 960-point Hann STFT with a 480-sample hop, whole-utterance recurrent inference, and inverse STFT. The converted model is about 2.4 MiB. On a release build on the project reference x86-64 Linux host, the fixed two-second regression fixture took 1.58 seconds (1.3x realtime) and used 44,628 KiB maximum RSS. Runtime and memory grow with utterance length.
Run the reproducible real-speech quality gate after conversion:
To prepare the pinned Apache-2.0 MossFormer2 SE 48 kHz model:
|
The adapter uses 48 kHz audio, 40 ms Kaldi fbank frames at an 8 ms shift, first- and second-order deltas, a non-centred 1,920-point symmetric-Hamming STFT, and the official four-second/three-second-stride edge-discard reconstruction. The converted graph is about 217 MiB. On the reference x86-64 Linux host, a four-second mono fixture took 7.74 seconds and used 483,400 KiB maximum RSS in a release build. Model weights are not bundled.
Run the pinned real-speech quality gate after conversion:
To prepare the pinned MIT-licensed SGMSE+ VoiceBank+DEMAND model:
|
The adapter reproduces the official noisy-peak normalization, centered
510-point periodic-Hann STFT with a 128-sample hop, complex square-root
spectrum transform, and OUVE predictor/corrector sampler. The explicit
quality/speed choice is the upstream 30 reverse steps with one ALD corrector
step (snr=0.5), or 60 score-network evaluations. The graph is about 252 MiB
and weights are not bundled. On the reference x86-64 Linux host, the pinned
two-second mono fixture took 737.92 seconds and used 1,204,648 KiB maximum RSS
in a release build. This backend prioritizes generative quality rather than
interactive speed.
Run the pinned quality gate after conversion (expect a long CPU run):
Quick start
# Best classical quality
# RNNoise AI backend
# DeepFilterNet v3 AI backend
# Advanced DSP options
Prebuilt binaries
Each GitHub Release contains
prebuilt full-feature binaries for:
- Linux x86-64
- macOS Intel and Apple Silicon
- Windows x86-64
Every archive has a matching .sha256 checksum file.
Install with Cargo
The crates.io package provides the CLI and library with the classical DSP and optional RNNoise backends:
For the embedded DeepFilterNet backend, use a prebuilt GitHub binary or build
this repository with its primary Cargo.toml.
Publishing a release
- Set the same version in
Cargo.tomlandCargo.crates-io.toml, then updateCargo.lock. - Commit and push the version change.
- Create and push a matching tag:
The GitHub Release workflow validates that the tag matches Cargo.toml, runs
the full test suite, builds all supported platforms, attaches archives and
checksums, and publishes generated release notes. A failed build leaves the
release as a draft so it cannot expose an incomplete asset set.
CLI highlights
-b, --backend <NAME> classical|rnnoise|deepfilter
-a, --algorithm <NAME> omlsa|logmmse|mmse|wiener|specsub|specsub-nl|specsub-geo
--window <NAME> hann|hamming|sine|blackman|kaiser|flattop|dpss
--kaiser-beta <B> Kaiser β (default 8.0)
--dpss-nw <NW> DPSS bandwidth (default 3.0)
--multiband Multiband spectral subtraction
--perceptual Bark perceptual gain weighting
--postfilter Musical-noise suppression post-filter
-p hifi Flagship preset (Kaiser + perceptual + postfilter)
--quality ultra Maximum fidelity settings
--onnx-model <PATH> Waveform ONNX model used by the onnx backend
--onnx-rate <HZ> Model sample rate (default: 16000)
Library API
use ;
let cfg = HiFi.config;
denoise_file_with_backend?;
// With DeepFilterNet (GitHub/source build with --features full)
denoise_file_with_backend?;
Roadmap status
| Priority | Technology | Status |
|---|---|---|
| 1 | DeepFilterNet v3 | ✅ --features deepfilter |
| 2 | RNNoise | ✅ --features rnnoise |
| 3 | Kaiser/Flat-top/DPSS windows | ✅ |
| 4 | Multiband / nonlinear SpecSub | ✅ |
| 5 | Perceptual weighting + musical-noise PF | ✅ |
| 6 | Pure-Rust external ONNX inference foundation | 🟨 waveform contract implemented |
| 7 | BSRNN / MP-SENet / MossFormer2 adapters | ✅ implemented and quality-gated |
| 8 | SGMSE+ | ✅ 30-step PC sampler + score-model adapter |
See ROADMAP.md for the implementation audit and the acceptance criteria and numerical evidence for each named model.
License
The Rust project is MIT licensed. See THIRD_PARTY.md for the Apache-2.0 BSRNN conversion code and CC-BY-4.0 model attribution.