fix: don't send tts start on wake word - it stops ESP32 recording

ESP32 stops sending audio when it receives tts start because it
thinks the server is speaking. Just acknowledge detect silently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hailin 2026-04-06 07:03:16 -07:00
parent f479f156b9
commit b39dab2536
1 changed files with 2 additions and 7 deletions

View File

@ -194,16 +194,11 @@ class Relay:
elif msg_type == "listen":
state = msg.get("state")
log.debug(f"ESP32 listen: {state}")
log.info(f"ESP32 listen: {state}")
if state == "detect":
# Wake word detected — acknowledge
text = msg.get("text", "")
log.info(f"Wake word: {text}")
# Send TTS start to keep ESP32 happy
await self.ws.send(json.dumps({
"type": "tts", "state": "start",
"session_id": msg.get("session_id", "")
}))
# Don't send tts start — let ESP32 continue recording
elif msg_type == "abort":
log.info("ESP32 abort")