| Crates.io | ten_vad |
| lib.rs | ten_vad |
| version | 0.1.0 |
| created_at | 2026-01-17 21:14:05.638113+00 |
| updated_at | 2026-01-17 21:14:05.638113+00 |
| description | High-performance Voice Activity Detection (VAD) library using ONNX Runtime, based on TEN Framework. |
| homepage | |
| repository | https://github.com/drmckay/ten_vad_rs |
| max_upload_size | |
| id | 2051175 |
| size | 645,916 |
Rust bindings for TEN VAD (Voice Activity Detection), built from source.
ORT_ROOT or ONNXRUNTIME_DIR environment variable set to the ONNX Runtime installation directory (containing include and lib subdirectories).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(())
}
To build this crate, ensure you have the C++ toolchain and ONNX Runtime available.
export ORT_ROOT=/path/to/onnxruntime
cargo build