Turn-Taking (VIVA SDK)

Predict when the user has finished speaking, so your voice AI agent responds at the right moment.

Turn-Taking (TT) predicts when the user has finished their turn in a human-to-bot conversation, so your agent can respond without awkward pauses and without cutting the user off. It replaces silence-based end-of-turn detection with a small model that listens to how the user speaks.

The model uses audio only. It analyses acoustic and prosodic cues such as changes in pitch, energy and intonation, pauses and speaking rate. For example, a drop in energy followed by a pause is a typical turn-ending cue. For the technical background, see the blog posts Turn-taking for voice AI and Krisp Turn-Taking v2.

Choose how to detect turns

Krisp offers turn detection in two places:

VIVA SDK Turn-TakingKrisp API: STT for Agents
Where it runsOn your servers, inside your audio pipelineIn Krisp's cloud, as part of speech-to-text
What you getAn end-of-turn probability for every frame; you decide when the turn endsA turn event on the transcript stream when the turn ends
Voice activityYou supply it from your own VAD (TTv3)Built in
TuningYour probability thresholdturn.sensitivity, turn.max_silence, turn.silence_validation
Use it whenYou run your own STT, or you use a framework such as PipecatYou also want Krisp's transcripts

How the SDK model works

This section follows TTv3, the current version: model krisp-viva-tp-v3, introduced in VIVA SDK v9.17.0 (C/C++) and the matching Python, Node.js, Go and Rust releases. See the migration guide if you use TTv2.

  1. Clean the audio first. Deploy TT on the output of Voice Isolation. Background voices otherwise look like the user still speaking.
  2. Detect voice activity. Run your VAD on each frame. TTv3 uses your VAD's decision instead of its own.
  3. Process each frame. Pass the audio frame, whether voice was detected, and whether the bot is currently speaking. Setting botSpeaking to true resets the model's state between turns.
  4. Compare with a threshold. The model returns the probability, between 0 and 1, that the user has finished. Until the first result is ready, it returns the previous value.

The input frame duration is set in the session config (the official samples use 20 ms frames), and the TTv3 model krisp-viva-tp-v3 works with all languages.

Parameters

ParameterValuesEffect
inputSamplesOne audio frameThe audio to analyse.
voiceDetectedtrue / falseYour VAD's decision for this frame.
botSpeakingtrue / falseWhether the bot is speaking. true resets the internal state between turns.
Threshold0.3 – 0.5 (recommended)Lower values (0.3) end turns sooner but cause more false end-of-turn decisions. Higher values (0.5) wait slightly longer and make fewer mistakes.

Tradeoffs

  • A lower threshold gives faster responses, but the agent may start talking while the user only pauses mid-sentence.
  • A higher threshold gives fewer interruptions, but the user waits slightly longer for the reply.
  • Clean audio matters more than the threshold. Without Voice Isolation in front, background speech keeps the probability low and delays the turn end.

Code

Troubleshooting

  • The agent interrupts the user. Raise the threshold toward 0.5, and check that Voice Isolation runs before TT.
  • The agent answers late. Lower the threshold toward 0.3, and check that botSpeaking is reset to false when the bot stops speaking.

Did this page help you?