VoiceActivityDetectorBase<T>

Base Classes · AiDotNet.Audio.VoiceActivity

Base class for algorithmic voice activity detection implementations (non-neural network).

Implements: IVoiceActivityDetector<T>

Known derived types: EnergyBasedVad<T>

For Beginners

VAD answers a simple question: “Is someone speaking right now?”

Common uses:

  • Skip silence during transcription
  • Reduce transmission bandwidth in VoIP
  • Trigger recording only when speech is detected
  • Segment audio into speaker turns

This base class provides:

  • Frame-based processing with hangover logic
  • Streaming mode with state management
  • Segment detection across entire audio files

For neural network-based VAD (like Silero), see classes that extend AudioNeuralNetworkBase.

How It Works

Voice Activity Detection (VAD) determines whether audio contains speech or silence. This is fundamental to many audio applications including speech recognition, communication systems, and noise reduction.

Properties

Property Summary
double Threshold { get; set; }
int FrameSize { get; set; }
int MinSilenceDurationMs { get; set; }
int MinSpeechDurationMs { get; set; }
int SampleRate { get; set; }

Methods

Method Summary
IReadOnlyList<ValueTuple<int, int>> DetectSpeechSegments(Tensor<T> audio)
T GetSpeechProbability(Tensor<T> audioFrame)
T[] GetFrameProbabilities(Tensor<T> audio)
ValueTuple<bool, T> ProcessChunk(Tensor<T> audioChunk)
bool DetectSpeech(Tensor<T> audioFrame)
void ResetState()