streaming-tts-pipeline

Diagnose and fix chunking, parsing, and DSP defects in streamed LLM-to-speech pipelines.

3|1|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/PALabs-v1/AI_friend --skill streaming-tts-pipeline-palabs-v1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: streaming-tts-pipeline
Source: https://github.com/PALabs-v1/AI_friend/tree/main/.claude/skills/streaming-tts-pipeline
Command: npx skills add https://github.com/PALabs-v1/AI_friend --skill streaming-tts-pipeline-palabs-v1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Streamed LLM-to-speech pipelines fail in subtle ways: choppy clause chunking, split words from sub-word tokens, leaked control tags, spliced audio, and runaway reverb feedback. This Skill documents five real defect patterns found in a production voice pipeline and the exact fixes for each. ## Core Features & Use Cases - Clause-boundary chunking guidance: Explains why timer-based flushes and off-by-epsilon threshold comparisons break semantic segmentation, and how to verify fixes against measured latency. - Fragment and token handling: Covers filtering degenerate punctuation-only fragments before synthesis, merging rather than dropping them, and reconstructing whole words from sub-word LLM token streams with two-sided boundary checks. - Audio correctness patterns: Details incremental control-token parsing with partial-token hold-back, drop-newest backpressure for PCM queues, and correct OLA crossfade and feedback-delay reverb implementation. - Use Case: When a voice agent's speech output sounds choppy, drops words, or clips unexpectedly, use this Skill to identify which of the five documented defect classes matches the symptom and apply the corresponding fix. ## Quick Start Ask the assistant to review the TTS chunker and audio queue code for the streaming speech defects described in this Skill.

Frequently Asked Questions about streaming-tts-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I chunk streamed LLM output for text-to-speech synthesis?

Chunk at clause boundaries using punctuation-based scoring rather than fixed word counts or timers. A latency safety-net timer should only fire as a genuine fallback, with its threshold set well above measured per-token latency so the semantic rule wins normally.

Why does my TTS output have split words or extra spaces?

Sub-word LLM tokens can arrive without leading spaces, so splitting each chunk independently inserts false word boundaries. Check both sides of the boundary: glue a fragment onto the word in progress unless either side carries whitespace.

How do I parse pause and emotion tags in a streamed text-to-speech pipeline?

Parse against the accumulated buffer with partial-token hold-back, since tags like <pause=200ms> often arrive split across tokens. Clamp parsed durations so a hallucinated value cannot trigger an extreme pause.

What should I drop when a PCM audio queue overflows?

For synthesized speech, drop the newest incoming frame or apply backpressure, never the oldest. Dropping the oldest splices non-adjacent PCM chunks together, causing audible discontinuities and missing words mid-sentence.

Why does my reverb effect clip or run away on normal speech?

A feedback delay line fed from the output signal instead of the input creates runaway gain approaching 1/(1-gain), turning downstream clamping into hard clipping. Feed the delay line from the input and reset its state per utterance, not per chunk.