Skip to content

feat(voice): stream Pocket audio during synthesis - #133

Draft
johnmatthewtennant wants to merge 10 commits into
jtennant/vendor-pocket-tts-enginefrom
jtennant/stream-pocket-tts-audio
Draft

feat(voice): stream Pocket audio during synthesis#133
johnmatthewtennant wants to merge 10 commits into
jtennant/vendor-pocket-tts-enginefrom
jtennant/stream-pocket-tts-audio

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the Pocket side of the duplex stream: streaming TTS synthesis chunks -> playback.

Berd now owns one Pocket engine and one audio player for an utterance. The backend accepts incremental text, releases the first complete sentence immediately, then forms model-safe chunks under the 50-token Pocket limit. Each chunk is synthesized while already-produced PCM continues playing, and decoder PCM blocks are appended to the same player as soon as they are available. Synthesis no longer waits for prior playback to finish.

This PR provides the backend stream. PR #135 connects streaming LLM text to it.

Reviewer-reproducible examples

  • With a long Pocket-voiced response, listen at the boundary between the first and second sentences. Speech should continue without the old synthesis-sized silence between them.
  • Interrupt a long response shortly after playback starts. Audio and queued synthesis should stop as one utterance, rather than advancing through separately tracked sentence jobs.
  • Observe the response status during playback. The backend emits one started/completed or started/interrupted lifecycle for the whole utterance, not one lifecycle per synthesis chunk.

@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review August 19, 2026 21:55
@johnmatthewtennant
johnmatthewtennant marked this pull request as draft August 20, 2026 01:43
@johnmatthewtennant
johnmatthewtennant force-pushed the jtennant/stream-pocket-tts-audio branch from a60546a to c6b83a0 Compare August 20, 2026 11:44
@johnmatthewtennant
johnmatthewtennant force-pushed the jtennant/stream-pocket-tts-audio branch from c6b83a0 to 63deda0 Compare August 20, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant