{
  "_description": "Tunables for voice/* modules. Loaded via core.config_loader.load('voice').",
  "sanad_voice": {
    "_comment": "voice/sanad_voice.py — main live voice subprocess. Gemini API credentials (api_key, model, voice_name) come from core_config.json's gemini_defaults — single source of truth.",
    "mic_gain": 1.0,
    "play_chunk_bytes": 96000,
    "log_dir": "~/logs",
    "log_name": "gemini_live_v2",
    "session_timeout_sec": 660,
    "max_reconnect_delay_sec": 30,
    "max_consecutive_errors": 10,
    "no_messages_timeout_sec": 180,
    "pure_voice": false,
    "internet_search": false
  },
  "mic_udp": {
    "_comment": "G1 built-in mic — UDP multicast subscriber",
    "group": "239.168.123.161",
    "port": 5555,
    "buffer_max_bytes": 64000,
    "read_timeout_sec": 0.04,
    "socket_timeout_sec": 1.0
  },
  "speaker": {
    "_comment": "G1 built-in speaker — AudioClient.PlayStream wrapper",
    "app_name": "sanad",
    "begin_stream_pause_sec": 0.15,
    "wait_finish_margin_sec": 0.3,
    "jitter_prebuffer_sec": 0.3,
    "jitter_first_flush_sec": 0.6,
    "jitter_max_lead_sec": 0.6
  },
  "vad": {
    "_comment": "Gemini Live server-side voice-activity-detection config",
    "start_sensitivity": "START_SENSITIVITY_HIGH",
    "end_sensitivity": "END_SENSITIVITY_LOW",
    "prefix_padding_ms": 20,
    "silence_duration_ms": 200,
    "direct_answer": false
  },
  "barge_in": {
    "threshold": 500,
    "loud_chunks_needed": 3,
    "cooldown_sec": 0.3,
    "echo_suppress_below": 500,
    "ai_speak_grace_sec": 0.15,
    "external_barge_in": false
  },
  "recording": {
    "enabled": true,
    "dir_relative": "data/recordings"
  },
  "typed_replay": {
    "_comment": "voice/typed_replay.py — max_text_len comes from dashboard.api_input",
    "monitor_chunk_size": 512,
    "monitor_tail_sec": 0.2
  },
  "live_voice_loop": {
    "_comment": "voice/live_voice_loop.py — arm phrase dispatcher. arm_txt filename comes from core.script_files.arm_phrases",
    "trigger_log_size": 100,
    "poll_interval_sec": 0.1,
    "deferred_default": false,
    "trigger_enabled_default": false
  },
  "local_tts": {
    "_comment": "voice/local_tts.py — offline Coqui TTS",
    "model_subdir": "speecht5_tts_clartts_ar",
    "vocoder_subdir": "speecht5_hifigan",
    "xvector_filename": "arabic_xvector_embedding.pt",
    "sample_rate": 16000,
    "channels": 1
  }
}