{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jambonz.org/schema/components/vad",
  "title": "VAD",
  "description": "Voice Activity Detection configuration. Controls how jambonz detects the presence or absence of speech on the audio channel. Used to determine speech start/end boundaries for recognition and barge-in.",
  "type": "object",
  "properties": {
    "enable": {
      "type": "boolean",
      "description": "Whether to enable voice activity detection."
    },
    "voiceMs": {
      "type": "number",
      "description": "Duration of voice activity (in milliseconds) required before speech is considered to have started.",
      "examples": [250]
    },
    "silenceMs": {
      "type": "number",
      "description": "Duration of silence (in milliseconds) required before speech is considered to have ended.",
      "examples": [1000]
    },
    "strategy": {
      "type": "string",
      "description": "The VAD strategy to use."
    },
    "mode": {
      "type": "number",
      "description": "WebRTC VAD aggressiveness mode (0-3). Higher values are more aggressive at filtering non-speech. Only applies when vendor is 'webrtc'.",
      "minimum": 0,
      "maximum": 3
    },
    "vendor": {
      "type": "string",
      "description": "The VAD engine to use.",
      "enum": ["webrtc", "silero"]
    },
    "threshold": {
      "type": "number",
      "description": "Speech detection confidence threshold for Silero VAD. Value between 0 and 1, where higher values require greater confidence. Only applies when vendor is 'silero'.",
      "minimum": 0,
      "maximum": 1
    },
    "speechPadMs": {
      "type": "number",
      "description": "Padding in milliseconds added before and after detected speech segments. Prevents clipping utterance boundaries. Only applies when vendor is 'silero'."
    }
  }
}
