Skip to main content

Crate denoize

Crate denoize 

Source
Expand description

denoize — pure-Rust audio denoiser built for the world’s highest fidelity.

Goal: transparent, artifact-free restoration that preserves timbre, transients, dynamics, and “air” better than any classical offline tool.

§Implemented technologies

§Classical DSP (always available)

  • STFT/ISTFT + Perfect Reconstruction OLA(高オーバーラップ対応)
  • IMCRA/MCRA ノイズ推定 + Spectral Flatness プロファイル + Anchoring
  • Ephraim-Malah Decision-Directed SNR
  • 8種類のゲイン推定器(OMLSA, LogMMSE, MMSE-STSA, Wiener, SpecSub + 非線形/幾何学的)
  • Attack/Release + Cepstral Smoothing + Transient Protection
  • 高度窓関数: Kaiser / Flat-top / DPSS
  • マルチバンドスペクトルサブトラクション
  • 知覚重み付け(Bark帯域)+ 音楽ノイズ抑制ポストフィルタ

§Input / output codecs (built-in, no ffmpeg)

  • Decode: WAV / MP3 (nanomp3) / M4A (Pure Rust AAC-LC)
  • Encode: WAV / MP3 (shine-rs) / M4A (oxideav-aac Pure-Rust AAC-LC)
  • Decoded to f64 PCM at native sample rate (no extra quantisation)

§Optional AI backends (feature-gated)

  • rnnoise feature: RNNoise via nnnoiseless (pure-Rust)
  • deepfilter feature: DeepFilterNet v3 via tract ONNX
  • onnx feature: user-supplied waveform ONNX models via tract
  • mpsenet feature: MP-SENet compressed-magnitude/phase ONNX adapter
  • bsrnn feature: ESPnet BSRNN spectral ONNX adapter
  • mossformer2 feature: ClearerVoice MossFormer2 48 kHz ONNX adapter
  • sgmse feature: SGMSE+ iterative diffusion ONNX adapter

Build with all backends: cargo build --release --features full

Re-exports§

pub use audio::ensure_memory_limit;
pub use audio::estimate_audio_memory_bytes;
pub use audio::estimate_audio_working_set_bytes;
pub use audio::estimate_file_memory_bytes;
pub use audio::estimate_stream_memory_bytes;
pub use audio::read_audio;
pub use audio::read_wav;
pub use audio::read_wav_bytes;
pub use audio::sanitize_sample;
pub use audio::write_audio;
pub use audio::write_wav;
pub use audio::write_wav_bytes;
pub use audio::write_wav_channel_mask;
pub use audio::Audio;
pub use audio::WavStreamReader;
pub use audio::WavStreamWriter;
pub use backend::decode_mid_side;
pub use backend::encode_mid_side;
pub use backend::Backend;
pub use backend::BackendOptions;
pub use backend::ChannelMode;
pub use backend::OnnxModelConfig;
pub use backend::SgmseProfile;
pub use channel_layout::ChannelLayout;
pub use channel_layout::ChannelMask;
pub use channel_layout::ChannelPosition;
pub use channel_layout::PanInfo;
pub use decode::decode_file;
pub use decode::AudioFormat;
pub use decode::DecodedPcm;
pub use denoiser::Denoiser;
pub use denoiser::DenoiserConfig;
pub use denoiser::Preset;
pub use denoiser::ProcessingMode;
pub use denoiser::StreamingDenoiser;
pub use encode::AacEncoder;
pub use encode::DownmixMode;
pub use encode::EncodeOptions;
pub use encode::OutputFormat;
pub use gain::Algorithm;
pub use gain::SpecSubLaw;
pub use window::WindowParams;
pub use window::WindowType;

Modules§

audio
Audio file I/O: WAV read/write (hound) + unified decode for MP3/M4A/WAV.
backend
Optional AI denoising backends (feature-gated).
benchmark
Objective quality and stereo-imaging reports.
bessel
Special functions needed by the Ephraim-Malah family of gain estimators: modified Bessel functions of the first kind, orders 0 and 1, and the exponential integral E1.
channel_layout
Standard channel layouts used by the audio pipeline.
decode
denoize 自作デコード層 — lossless / lossy audio containers を高品質 PCM (f64) へ。
denoiser
The de-noizer: ties together STFT, IMCRA noise estimation, the decision-directed a-priori SNR estimator, the selected spectral gain estimator, attack/release + cepstral gain smoothing, transient protection, and optional pre-emphasis.
encode
Audio encode layer — WAV / MP3 / M4A output.
fft
A self-contained, allocation-light, iterative radix-2 Cooley-Tukey FFT.
gain
Spectral gain estimators.
loudness
EBU R128 / ITU-R BS.1770 loudness measurement and normalization.
metadata
Cross-container audio metadata preservation.
models
Versioned external-model manifest and verified local cache.
noise
Noise-power-spectral-density estimation.
perceptual
Perceptual weighting for spectral gain control.
postfilter
Musical-noise suppression post-filter.
resample
Band-limited, channel-synchronous sample-rate conversion.
service
Shared application service used by the CLI and graphical frontends.
stft
Short-time Fourier transform engine with perfect-reconstruction overlap-add (OLA) synthesis.
stream
Stateful block-processing API for realtime and pipe integrations.
vad
Lightweight energy VAD and speech-region segmentation.
window
Window functions for short-time Fourier analysis/synthesis.

Functions§

denoise_audio_with_backend_config
Process already-decoded audio in place. This is the path used by stdin and embedders that do not have filesystem-backed input.
denoise_file
Denoise a WAV file end-to-end, writing the result to output.
denoise_file_with_backend
Denoise with an explicit backend (classical / rnnoise / deepfilter).
denoise_file_with_backend_config
Denoise with explicit backend, encoder, and backend-specific model options.
denoise_file_with_backend_opts
Denoise with explicit backend and output encode options.