feat(channels): wire TTS voice reply into web adapter (#1347)#1351
Open
feat(channels): wire TTS voice reply into web adapter (#1347)#1351
Conversation
Mirrors the Telegram adapter's voice flow: track voice sessions, buffer text by sentence, synthesize via TTS, send audio_delta events. - Add `AudioDelta` and `AudioDone` WebSocket event types - Add `voice_reply` field to inbound WebSocket payload - Add `tts_service` and `voice_session_keys` to WebAdapter - Buffer text deltas at sentence boundaries, synthesize via TTS - Broadcast base64-encoded audio chunks as `audio_delta` events - Graceful degradation: TTS failure logs warning, text stream unaffected - Derive `Clone` on `TtsService` (symmetric with `SttService`) - Wire `tts_service` to WebAdapter in app startup Closes #1347 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
AudioDeltaandAudioDoneWebSocket event types for streaming audio to clientsvoice_replyfield in inbound WebSocket payloadCloneonTtsService(symmetric withSttService) to simplify sharing across adaptersType of change
enhancementComponent
backendCloses
Closes #1347
Test plan
cargo check -p rara-channels -p rara-apppassescargo clippy -p rara-channels -p rara-app -p rara-tts --all-targets --no-deps -- -D warningscleancargo test -p rara-channels -p rara-ttsall pass{"content": "hello", "voice_reply": true}via WebSocket, verifyaudio_deltaandaudio_doneevents received🤖 Generated with Claude Code