Expand description
§rustvani-vad
Pure Rust Silero VAD with bundled weights — zero external runtime dependencies.
SIMD-accelerated (AVX2+FMA on x86_64), ~90% less memory than Python Pipecat.
§Quick start
ⓘ
use rustvani_vad::{SileroVad, StateMachine, VadParams, VadState};
// Inference engine (weights are compiled in — nothing to download)
let vad = SileroVad::new()?;
// State machine for stream processing
let mut sm = StateMachine::new(16000, VadParams::default());
// Feed audio chunks in a loop
for chunk in audio_chunks {
if let Some(window) = sm.next_window(&chunk) {
let confidence = vad.infer(&window)?;
match sm.advance(confidence, &window) {
VadState::Speaking => { /* user is talking */ }
VadState::Quiet => { /* silence */ }
_ => {}
}
}
}§Async (requires tokio feature)
ⓘ
let confidence = vad.infer_async(window).await?;Structs§
- Silero
Vad - Pure Rust Silero VAD — no ONNX runtime, bundled weights.
- State
Machine - Stateful VAD state machine.
- VadParams
- Parameters controlling VAD sensitivity and timing.
Enums§
- VadState
- Voice Activity Detection states.
Constants§
- BYTES_
PER_ WINDOW - Number of bytes per inference window (512 samples × 2 bytes/sample).
- SAMPLES_
PER_ WINDOW - Number of PCM samples per inference window at 16 kHz.
Functions§
- calculate_
audio_ volume - Calculate audio volume as a normalised 0.0–1.0 value (dBFS-based).
- exp_
smoothing - Exponential smoothing:
current × factor + prev × (1 - factor).