feat(voice): fall back to macOS say when ElevenLabs unavailable#897
Closed
blu3dot wants to merge 1 commit intodanielmiessler:mainfrom
Closed
feat(voice): fall back to macOS say when ElevenLabs unavailable#897blu3dot wants to merge 1 commit intodanielmiessler:mainfrom
blu3dot wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
When ELEVENLABS_API_KEY is missing or the ElevenLabs API call fails, the VoiceServer now falls back to macOS native `say` command instead of silently skipping voice output. Pronunciation rules from pronunciations.json are applied to the fallback too. - Only triggers when ElevenLabs path didn't play (no double-speak) - Reuses existing spawnSafe() and applyPronunciations() helpers - Fails gracefully — logs error, doesn't crash server - Uses error: unknown with instanceof type guard - TODO: Linux equivalent (see danielmiessler#855, danielmiessler#872) Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
Closing to test locally before resubmitting. |
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.
Summary
When
ELEVENLABS_API_KEYis missing or the ElevenLabs API call fails, VoiceServer now falls back to the macOS nativesaycommand instead of silently skipping voice output. This gives new users immediate voice feedback without requiring ElevenLabs setup.Problem
VoiceServer silently skips all TTS when
ELEVENLABS_API_KEYis missing. New users who haven't configured ElevenLabs get zero voice feedback with no indication why — the server returns HTTP 200, making the failure invisible.Solution
After the ElevenLabs TTS path is skipped (no API key) or fails (API error), fall back to
/usr/bin/say:applyPronunciations()so custom pronunciation rules apply to native voice toospawnSafe()helper (array-form spawn, no shell injection)error: unknownwithinstanceoftype guard (also upgrades the adjacent ElevenLabs catch block)macOS-only —
sayis present on all macOS versions. Linux equivalent is out of scope for this PR (see #855, #872 for cross-platform audio work).Test plan
ELEVENLABS_API_KEY→ send notification → hear macOSsayvoiceELEVENLABS_API_KEY→ send notification → ElevenLabs fails → fallback tosaypronunciations.jsonapply tosayoutputPost-Deploy Monitoring & Validation
No additional operational monitoring required: additive fallback path, existing behavior unchanged when ElevenLabs key is configured.