$ show snakers4/silero-vad
Silero VAD is a pre-trained enterprise-grade Voice Activity Detector library that provides speech detection capabilities for audio signals. The system consists of a core PyTorch model (also available in ONNX format) with Python utilities for audio processing, speech timestamp extraction, and streaming applications. It supports 8kHz and 16kHz sampling rates and includes a VADIterator class for real-time processing. The repository offers multi-language examples (C++, C#, Go, Haskell, Java, Rust) demonstrating integration, along with tools for model tuning and sequence-based ONNX optimization for improved performance on long audio files.
The LLM identified 3 files worth highlighting for reuse:
Contains the core VAD implementation including get_speech_timestamps() and VADIterator classes. Implements robust speech detection algorithms with proper state management, minimum duration filtering, speech padding, and threshold handling. Abstracts audio I/O over torchaudio/torchcodec backends. Demonstrates non-obvious skill in temporal audio processing and edge case handling. Highly reusable as a standalone VAD component.
Implements batched ONNX inference for Silero VAD to overcome Python GIL limitations in streaming scenarios. Processes multiple audio frames in a single ONNX call while maintaining bit-exact compatibility with the frame-by-frame streaming model. Significantly reduces CPU overhead for long audio files by moving the processing loop into GIL-releasing ONNX Runtime kernels. Shows advanced understanding of ONNX Runtime optimization techniques.
Exports a state-preserving Silero VAD model for offline sequence inference from the packaged TorchScript weights. Properly reconstructs the model architecture, validates weight mappings, uses dynamic sequence axes, and runs ONNX model checking. Includes comprehensive validation and benchmarking tools. Demonstrates expertise in model conversion and optimization for deployment scenarios.