Use macOS say to read the assistant's response out loud whenever the conversation came from Voice Wake/voice recognition. Do not use the tts tool (it calls cloud providers).
say (CHECK EVERY MESSAGE INDIVIDUALLY)IF the user message STARTS WITH: User talked via voice recognition
say first (so the user knows you heard them)IF the user message does NOT start with that exact phrase
say. Text-only response only.Critical:
1) Detect Voice Wake context
User talked via voice recognition2) Prepare spoken text
3) Speak with say (local macOS TTS)
printf '%s' "$SPOKEN_TEXT" | say
Optional controls (use only if set):
printf '%s' "$SPOKEN_TEXT" | say -v "$SAY_VOICE"
printf '%s' "$SPOKEN_TEXT" | say -r "$SAY_RATE"
say is unavailable or errors, still send the text response and note that TTS failed.共 1 个版本