Skip to content

wangfu91/ten-vad-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎤 ten-vad-rs

Crates.io Docs.rs License

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:

[dependencies]
ten-vad-rs = "0.1.1" # Replace with the latest version

🚀 Quick Start

Here's a simple example using a WAV file:

use ten_vad_rs::TenVad;

let mut vad = TenVad::new("onnx/ten-vad.onnx", 16000).unwrap();
let audio_frame = vec![0i16; 256]; // 16-bit PCM audio samples in 16kHz
let vad_score = vad.process_frame(&audio_frame).unwrap();

See the examples/ directory for more advanced usage:

  • wav_file_vad.rs — Run VAD on a WAV file
  • microphone_vad.rs — Real-time VAD from microphone

🛠️ Building

Requires Rust and a working ONNX Runtime environment. Build with:

cargo build --release

🤝 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.

About

A Rust library for working with the TEN VAD (Voice Activity Detection) ONNX model.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages