flexaudio-denoise 0.2.0

Offline noise suppression (RNNoise via nnnoiseless, model weights embedded) for flexaudio.
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented1 out of 8 items with examples
  • Size
  • Source code size: 34.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 516.46 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Studio-Sadola/flexaudio
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tsubome

flexaudio-denoise

Offline noise suppression for Rust, powered by RNNoise via the pure-Rust nnnoiseless port. The model weights are embedded in the library, so denoising runs fully offline — no model file to ship and no network access at runtime. It targets stationary microphone noise such as fans, air conditioning, and keyboard rumble.

This crate is independent of flexaudio-core: it consumes plain interleaved &[f32] samples (±1.0 normalized, 48 kHz), so you can pair it with any audio source. The i16-range scaling that nnnoiseless expects is handled internally.

Latency & carry-over semantics

RNNoise processes fixed 480-sample (10 ms) frames, so process slices its input into frames internally and carries the remainder over to the next call. The output is the input delayed by exactly 480 samples per channel, independent of call granularity:

  • process fills the buffer it receives in place, same length. The first 480 samples/ch of the stream are the delay padding (silence).
  • flush returns the final 480 samples/ch and closes the stream, leaving the denoiser reset for a new stream. Total output = total input + 480/ch.

Example

use flexaudio_denoise::{Denoiser, FRAME_SIZE};

let mut dn = Denoiser::new(1).unwrap(); // 1 = mono, 2 = stereo interleaved
let mut chunk = vec![0.0f32; 1000];     // ±1.0 normalized, 48 kHz
dn.process(&mut chunk).unwrap();        // in place, delayed by 480 samples
let tail = dn.flush();                  // the remaining 480 samples/ch
assert_eq!(tail.len(), FRAME_SIZE);

With flexaudio

flexaudio delivers 48 kHz interleaved f32 chunks, which is exactly what Denoiser consumes — denoise the microphone stream before encoding or transcription:

let mut dn = flexaudio_denoise::Denoiser::new(2).unwrap();
while let Some(mut chunk) = capture.next_chunk() {
    dn.process(&mut chunk).unwrap();
    sink.write(&chunk);
}
sink.write(&dn.flush());

License & third-party notices

MIT © 2026 tubome / Studio Sadola.

This crate depends on nnnoiseless (BSD-3-Clause), a pure-Rust port of Xiph's RNNoise (also BSD-3-Clause), and embeds its RNNoise model weights in every binary. Ship the nnnoiseless/RNNoise BSD-3-Clause notice alongside binaries that include this crate.