SileroVad<T>
Models & Types · AiDotNet.Audio.VoiceActivity
Silero Voice Activity Detection model - high accuracy neural network VAD.
Inheritance: NeuralNetworkBase<T> → AudioNeuralNetworkBase<T> → SileroVad<T>
Implements: IVoiceActivityDetector<T>
For Beginners
Silero VAD tells you when someone is speaking vs silence. Unlike simple energy-based VAD, it uses a neural network that has learned what speech “looks like” from millions of examples.
Why use neural network VAD?
- Much more accurate than energy/threshold-based methods
- Handles background noise better (music, crowd noise, etc.)
- Detects speech even when quiet
- Doesn’t false-trigger on non-speech sounds
Two ways to use this class:
- ONNX Mode: Load pretrained Silero model for fast inference
- Native Mode: Train your own VAD model from scratch
ONNX Mode Example (recommended):
Training Mode Example:
How It Works
Silero VAD is a state-of-the-art voice activity detector that uses a lightweight neural network architecture to achieve high accuracy with low latency. It can:
- Detect speech with very high accuracy (better than energy-based methods)
- Handle noisy environments well
- Run in real-time on CPU
- Work across multiple languages
Constructors
| Constructor | Summary |
|---|---|
SileroVad(NeuralNetworkArchitecture<T> architecture, SileroVadOptions options) |
Creates a Silero VAD in native training mode for training from scratch. |
SileroVad(NeuralNetworkArchitecture<T> architecture, string modelPath, SileroVadOptions options) |
Creates a Silero VAD in ONNX inference mode with a pretrained model. |
Properties
| Property | Summary |
|---|---|
double Threshold { get; set; } |
|
int FrameSize { get; } |
|
int MinSilenceDurationMs { get; set; } |
|
int MinSpeechDurationMs { get; set; } |
Methods
| Method | Summary |
|---|---|
Dictionary<string, Tensor<T>> GetNamedLayerActivations(Tensor<T> input) |
|
IReadOnlyList<ValueTuple<int, int>> DetectSpeechSegments(Tensor<T> audio) |
|
ModelMetadata<T> GetModelMetadata() |
|
T GetSpeechProbability(Tensor<T> audioFrame) |
|
T[] GetFrameProbabilities(Tensor<T> audio) |
|
Tensor<T> ForwardForTraining(Tensor<T> input) |
|
ValueTuple<bool, T> ProcessChunk(Tensor<T> audioChunk) |
|
bool DetectSpeech(Tensor<T> audioFrame) |