able-jackal-84140
07/14/2025, 5:59 AMtall-airline-16756
07/14/2025, 5:59 AMtall-airline-16756
07/14/2025, 6:00 AMstream.push_text(chunk)
within async for chunk in text
, the chunk is sent downstream for processing immediately rather than being buffered or delayed for future input. The processing flow is as follows:
• The text chunk is immediately placed in an input channel as soon as push_text
is called.
• Tokenization and other processing steps occur as input is received, typically in real-time.
• The chunk is streamed to the TTS service as soon as it's available, resulting in low-latency streaming.
The flush()
method is only used for explicitly marking segment boundaries, not for forcing delayed input to be sent. Your partial chunk should be processed and sent as soon as it is received by push_text
.
If you are observing a delay, the cause is likely in downstream tokenization or in the TTS implementation itself, but it is not a result of upstream buffering in tts_node
or push_text
itself.
Sources: livekit-agents/livekit/agents/voice/generation.py | pipeline-tts/tts_node.py