🎤 ten-vad-rs
A Rust library for working with the TEN VAD (Voice Activity Detector) ONNX model. A low-latency, high-performance and lightweight solution to detect speech in audio streams. 🚀
✨ Features
- 🎙️ Real-time voice activity detection
- 🦀 Pure Rust API
- 🧠 Powered by ONNX Runtime
- 📦 Easy integration into your audio projects
- 🛠️ Example code for microphone and WAV file VAD
📦 Installation
Add to your Cargo.toml:
[]
= "0.1.7" # Replace with the latest version
🚀 Quick Start
Here's a simple example using a WAV file:
use TenVad;
let mut vad = new.unwrap;
let audio_frame = vec!; // 16-bit PCM audio samples in 16kHz
let vad_score = vad.process_frame.unwrap;
See the examples/ directory for more advanced usage:
wav_file_vad.rs— Run VAD on a WAV filemicrophone_vad.rs— Real-time VAD from microphonepr_curve.rs— Compute precision-recall curves on the TEN-VAD TestSet
📊 PR Curve Evaluation
Generate precision-recall data using the Rust example. The ten-vad repository is required for test set files.
This produces PR_data_TEN_VAD_RS.txt with threshold / precision / recall rows.
The data can be compared to the base ten-vad implementation's PR curve results.

🛠️ Building
Requires Rust and a working ONNX Runtime environment. Build with:
🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.
📄 License
Licensed under the Apache-2.0 license.