VAD

March 12, 2026 · View on GitHub

Entry point group: opm.VAD Config entry point group: opm.VAD.config Template: ovos_plugin_manager.templates.vad


VADEngine base class

from ovos_plugin_manager.templates.vad import VADEngine

VAD plugins determine whether a given audio segment contains speech. They are used by ovos-dinkum-listener to trim leading/trailing silence before STT.

Constructor

VADEngine(config: Optional[dict] = None, sample_rate: Optional[int] = None)
AttributeTypeDefaultDescription
sample_rateint16000Audio sample rate in Hz.
padding_duration_msint300Ring buffer duration in ms.
frame_duration_msint30Frame size in ms.
threshfloat0.8Fraction of voiced frames needed to trigger speech detection.
num_padding_framesintderivedpadding_duration_ms / frame_duration_ms.

Abstract method (must implement)

is_silence(chunk: bytes) -> bool

Return True if the provided audio chunk does not contain speech.

Provided methods

extract_speech(audio: bytes) -> bytes

Remove leading and trailing silence from audio using a sliding ring-buffer algorithm. Returns only the voiced portion of the audio.

reset()

Reset any internal state. Called between utterances.

runtime_requirements (classproperty)

Defaults to fully offline.


AudioFrame

from ovos_plugin_manager.templates.vad import AudioFrame

Data class representing a single frame of audio.

AttributeTypeDescription
bytesbytesRaw PCM audio data.
timestampfloatStart time of the frame in seconds.
durationfloatDuration of the frame in seconds.

Configuration

VAD config is read from ovos.conf under listener.VAD:

{
  "listener": {
    "VAD": {
      "module": "ovos-vad-plugin-silero",
      "ovos-vad-plugin-silero": {
        "thresh": 0.5,
        "padding_duration_ms": 400
      }
    }
  }
}