step messages every 80 ms. Each step contains
semantic VAD predictions: the probability that the speaker will be
inactive at several future horizons. Use those probabilities together
with delay_in_frames and flush to build turn-taking that feels
responsive without cutting people off.
Use these signals to decide when an agent should respond.
STT is streaming: text arrives while the person is still speaking, and
every step updates the prediction of when they will stop. Your agent
doesn’t have to wait for the end of the turn to start working. It can
start preparing a reply from the partial transcript (for example, start
the LLM call early) and commit to it once the inactivity probability
confirms the turn has ended. If the person keeps talking, discard the
draft and start again with the new text.
Basic Rule
Start with the longest horizon and a threshold around0.5:
Full Loop
Adaptive Delay
delay_in_frames controls how much context the STT model uses before
emitting text. Each frame is 80 ms. Larger values can improve text
quality but delay output. Smaller values are more reactive but may be
less stable. Supported values are 7, 8, 10, 12, 14, 16,
20, 24, 32, 36, and 48.
When the app decides a turn has ended, send_flush() asks the server
to process outstanding audio and then returns a matching flushed
message. Treat flushed as the point where the current turn is ready
for the next stage of your agent pipeline.
Related
Speech-to-Text WebSocket
STT message types, VAD details, and flushing.
Transcription Settings
Tune
language, temp, padding_bonus, and delay_in_frames.