Deliver understandable audio without losing application state.
1. Chunking text
Sentence-aware chunks can start playback earlier while preserving pronunciation and meaning. Avoid splitting inside numbers or markup that the synthesizer would read incorrectly.
2. Playback ownership
Use one owner for queueing, audio focus and cleanup. Keep text display available when playback fails or the user prefers silent interaction.
3. Content filtering
Only synthesize user-facing content. Internal tool arguments, credentials and debugging traces should never enter the speech output stream.
Worked scenario
A tool error contains an internal URL. The spoken response uses a safe explanation while diagnostics remain in a redacted operator log.
Apply it
Build a playback queue with stop, completion and failure events and a visible text transcript.
Check your understanding
Text and audio represent the same approved user-facing response. Explain the decision and show evidence from your implementation or design. If you cannot demonstrate it yet, revisit the relevant section before continuing.