flexaudio-vad 0.2.0

Offline Voice Activity Detection (Silero VAD on ONNX Runtime, model embedded) for flexaudio.
Documentation
  • Coverage
  • 100%
    33 out of 33 items documented1 out of 11 items with examples
  • Size
  • Source code size: 2.42 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 939.76 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s 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-vad

Offline Voice Activity Detection for Rust, powered by the Silero VAD model running on ONNX Runtime. The model is embedded into the binary via include_bytes!, so detection runs fully offline — no model file to ship and no network access at runtime.

This crate is independent of flexaudio-core: it consumes a plain &[f32] sample stream, so you can pair it with any audio source.

Streaming example

use flexaudio_vad::{Vad, VadConfig, VadEvent};

let mut vad = Vad::new(VadConfig::default()).unwrap();
for chunk in some_audio_chunks() {
    for ev in vad.process(chunk) {
        match ev {
            VadEvent::SpeechStart { at_sample } => println!("start @ {at_sample}"),
            VadEvent::SpeechEnd { at_sample }   => println!("end @ {at_sample}"),
        }
    }
}
# fn some_audio_chunks() -> Vec<&'static [f32]> { vec![] }

Batch example

use flexaudio_vad::{get_speech_timestamps, VadConfig};

let samples: Vec<f32> = vec![0.0; 16_000];
let segments = get_speech_timestamps(&samples, &VadConfig::default()).unwrap();
for s in segments {
    println!("{}..{}", s.start_sample, s.end_sample);
}

VadConfig ships aggressive(), balanced(), and conservative() presets. Input is expected as 16 kHz mono f32.

Install

cargo add flexaudio-vad

MSRV

Rust 1.88 (required by the ort / ONNX Runtime toolchain).

License & third-party notices

MIT © 2026 tubome / Studio Sadola.

This crate redistributes the Silero VAD model (MIT) and a statically linked build of Microsoft ONNX Runtime (MIT) inside every binary. You MUST ship the accompanying notices — see THIRD_PARTY_NOTICES.md. The ONNX Runtime ThirdPartyNotices.txt for the pinned release still needs to be attached (legal review); this is flagged in that file.