From 0179ff97389b536b5af10bbacde9beb9b214ce31 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 11 Jul 2026 13:15:43 +0200 Subject: [PATCH] fix(voice): skip sounddevice on macOS to avoid TCC media-library prompt On macOS, initializing PortAudio/CoreAudio via sounddevice triggers a kTCCServiceMediaLibrary permission dialog even when no media-library access is needed. afplay already handles WAV (and every other format) natively, so route macOS playback straight to it and keep sounddevice for other platforms. Co-Authored-By: Claude Fable 5 --- tools/voice_mode.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/voice_mode.py b/tools/voice_mode.py index e4e583af8c64..67346133f5e5 100644 --- a/tools/voice_mode.py +++ b/tools/voice_mode.py @@ -1306,8 +1306,10 @@ def play_audio_file(file_path: str) -> bool: logger.warning("Audio file not found: %s", file_path) return False - # Try sounddevice for WAV files - if file_path.endswith(".wav"): + # On macOS, skip sounddevice entirely — PortAudio/CoreAudio init triggers + # a kTCCServiceMediaLibrary permission prompt even though we don't need it. + # afplay handles all formats natively without touching the media stack. + if file_path.endswith(".wav") and platform.system() != "Darwin": try: sd, np = _import_audio() with wave.open(file_path, "rb") as wf: