mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-29 18:46:59 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
0a5c5519fc
commit
0179ff9738
1 changed files with 4 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue