Skip to main content
Interruption handling ensures your voice agent responds naturally when users speak over the agent mid-response. Vision Agents handles interruptions automatically.
Vision Agents uses Stream Video for real-time WebRTC transport by default. External WebRTC transports are supported as well. Most AI providers offer free tiers to get started.

Automatic Handling

When you configure turn detection, the Agent class automatically:
  1. Detects when the user starts speaking from STT/turn signals
  2. Interrupts the active TTS or Realtime LLM
  3. Discards stale audio from before the interruption
  4. Flushes the audio track to clear buffered audio
  5. Listens to the user’s new input
  6. Responds appropriately
No custom event handlers required for basic interruption handling.

Stale audio protection

After an interruption, the agent ignores any already-generated audio that belongs to the previous response. This prevents “old” speech from leaking into the new turn.

Realtime APIs

If you’re using OpenAI Realtime, Gemini Live, AWS Bedrock, or Qwen, interruption handling is built-in at the model level. No turn detection plugin needed.
Realtime APIs are recommended for the most natural conversation flow with minimal latency.

Traditional Pipeline Setup

For the STT → LLM → TTS pipeline, you need turn detection. Some STT plugins include it automatically:
If your STT plugin does not include turn detection, add a separate plugin:
If you provide both an STT with built-in turn detection and a separate turn_detection plugin, the Agent automatically ignores the external plugin to prevent conflicts.

Custom Behavior

For app-triggered responses, make your own calls interruptible too:
You don’t need to call tts.interrupt() or llm.interrupt() yourself during normal conversation. The Agent handles interruptions automatically.

Tuning Sensitivity

Adjust turn detection parameters to control interruption response:

More Sensitive (Faster Response)

Use when: You want immediate response to any sound. Trade-off: May trigger on background noise.

Less Sensitive (More Deliberate)

Use when: You want to avoid false positives. Trade-off: Slower to respond to genuine interruptions.

Best Practices

Keep responses concise — Shorter responses mean fewer interruptions:
Acknowledge interruptions — Add context in your instructions:
Filter agent-originated signals — If you process raw turn signals, ignore events from the agent user:

Troubleshooting

Next Steps

Turn Detection

VAD vs Turn Detection concepts

Smart Turn

Full parameter reference