ten_vad

Crates.ioten_vad
lib.rsten_vad
version0.1.0
created_at2026-01-17 21:14:05.638113+00
updated_at2026-01-17 21:14:05.638113+00
descriptionHigh-performance Voice Activity Detection (VAD) library using ONNX Runtime, based on TEN Framework.
homepage
repositoryhttps://github.com/drmckay/ten_vad_rs
max_upload_size
id2051175
size645,916
Peter Veres (drmckay)

documentation

README

ten_vad

Rust bindings for TEN VAD (Voice Activity Detection), built from source.

Requirements

  • ONNX Runtime (C API) installed.
  • ORT_ROOT or ONNXRUNTIME_DIR environment variable set to the ONNX Runtime installation directory (containing include and lib subdirectories).

Usage

use ten_vad::TenVad;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let hop_size = 256;
    let threshold = 0.5;
    // The ONNX model is embedded in the library, so no model path is needed.

    let mut vad = TenVad::new(hop_size, threshold)?;
    
    let frame = vec![0i16; hop_size];
    let (prob, is_speech) = vad.process(&frame)?;
    println!("Probability: {}, Is Speech: {}", prob, is_speech);
    
    Ok(())
}

Build

To build this crate, ensure you have the C++ toolchain and ONNX Runtime available.

export ORT_ROOT=/path/to/onnxruntime
cargo build
Commit count: 1

cargo fmt