Repository navigation
Graceful TTS degradation + document Full Disk Access requirement - #6
Merged
Merged
Conversation
When the apple-tts pool can't hand out a worker (e.g. the engine can't load a voice because the launchd service lacks Full Disk Access to the Siri model cache), the handler let TtsWorkerError propagate out of handle_event, crashing the connection mid-stream. Home Assistant then received a half-open/empty audio stream and ffmpeg failed with "invalid start code [0][0][0][0] in RIFF header". Acquire the worker through a guarded _acquire_tts_worker() in both the synthesize and synthesize-start paths: on failure it logs and returns False so the caller emits a clean empty AudioStart/AudioStop envelope instead. _speak_text skips when no worker is held and its replace+retry is fully guarded. Also document the Full Disk Access requirement (install.sh NOTE + README), the root cause behind the ffmpeg error, since neural Siri voices load their model cache from the TCC-protected ~/Library/Group Containers/group.com.apple.SiriTTS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VgEMUdF2PNywdnyfzn4E89
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the TTS failure surfaced as HA ffmpeg
invalid start code [0][0][0][0] in RIFF header.Root cause: neural Siri voices load their model cache from
~/Library/Group Containers/group.com.apple.SiriTTS, a TCC-protected location. A launchd background service without Full Disk Access gets EPERM, soapple-ttsworkers die on startup. The handler then letTtsWorkerErrorpropagate out ofhandle_event, crashing the connection and sending HA a half-open/empty stream that ffmpeg rejects.Changes:
_acquire_tts_worker) in the synthesize and synthesize-start paths — on failure, emit a clean emptyAudioStart/AudioStopenvelope instead of crashing the connection._speak_textskips when no worker is held; its replace+retry is fully guarded.Tests: 2 new handler tests (worker-unavailable → empty envelope, streaming + non-streaming); full suite 72/72, ruff + mypy clean.
For
v2.0.0-beta2.🤖 Generated with Claude Code