VoiceBridge

Handling Interruptions, Barge-In, and Real-Time Speech Cut-Through

MYLINEHUB Team • 2026-02-09 • 11 min

How to implement real barge-in: detecting caller speech during TTS, cutting through audio safely, and keeping duplex conversation natural.

Handling Interruptions, Barge-In, and Real-Time Speech Cut-Through

Handling Interruptions (Barge-In) and Real-Time Speech Cut-Through in VoiceBridge

True full-duplex AI voice is not defined by whether audio flows in both directions. It is defined by whether a caller can interrupt the AI naturally — exactly like a human conversation.

If the AI keeps speaking while the caller talks, the experience becomes an IVR, not a real conversation. VoiceBridge solves this using a production-grade barge-in detection and cut-through control pipeline built directly into the RTP and realtime AI flow.

Architecture reference: MYLINEHUB VoiceBridge Architecture

Why barge-in is the real test of full-duplex voice

Many Asterisk AI integrations claim “real-time voice” but fail at interruptions. Common failures include:

  • Turn-based playback where caller must wait for TTS to finish.
  • One-way RTP during playback, preventing simultaneous speech.
  • No mechanism to cancel AI generation mid-response.

VoiceBridge treats barge-in as a core duplex requirement, not an optional feature.

Where barge-in logic lives in the VoiceBridge codebase

Barge-in is implemented inside the open-source VoiceBridge project: mylinehub-voicebridge

  • src/main/java/com/mylinehub/voicebridge/barge/BargeInController.java Core detection loop that evaluates caller speech energy and triggers interruption.
  • src/main/java/com/mylinehub/voicebridge/barge/AudioEnergy.java Lightweight PCM energy calculation used for real-time speech detection.
  • src/main/java/com/mylinehub/voicebridge/barge/OutboundAudioController.java Immediately stops outbound AI audio and clears RTP send queues.
  • src/main/java/com/mylinehub/voicebridge/openai/OpenAiRealtimeTruncateManager.java Cancels or truncates realtime AI generation so the conversation remains coherent.

How real-time interruption actually works

VoiceBridge performs barge-in using a continuous loop:

  1. Caller speech arrives via RTP from Asterisk.
  2. PCM frames are analyzed for energy above a defined threshold.
  3. Multiple consecutive frames confirm real speech (not noise).
  4. Outbound AI audio is stopped instantly.
  5. Realtime AI generation is truncated or cancelled.
  6. Conversation resumes with caller input as the next turn.

This ensures natural conversational timing instead of robotic turn-taking.

Speech detection strategy used by VoiceBridge

Instead of heavy Voice Activity Detection libraries, VoiceBridge uses a fast RMS-based energy model:

  • Per-frame PCM energy calculation.
  • Short sliding window smoothing.
  • Consecutive hit requirement to avoid noise triggers.
  • Cooldown window to prevent rapid stop/start flapping.

This approach is intentionally lightweight so it works reliably in real telecom RTP streams.

Instant AI audio cancellation and RTP cut-through

Detecting speech is only half the problem. The system must also stop AI audio immediately.

VoiceBridge achieves this using the outbound controller:

  • Clears queued audio packets.
  • Cancels active RTP send loops.
  • Resets pacing so new speech starts cleanly.

Without this, callers would still hear the tail end of AI speech after interrupting — breaking conversational realism.

Realtime AI truncation to keep conversation state correct

Even after local audio stops, the remote AI may still be generating audio. VoiceBridge therefore coordinates interruption with realtime AI sessions.

The truncation manager ensures:

  • AI stops producing unused audio.
  • Conversation state remains synchronized.
  • Next AI response reflects caller interruption correctly.

Barge-in flow inside a duplex VoiceBridge call

Caller Speech RTP Energy Detection Stop AI Audio

The key requirement is that interruption propagates through every stage of the duplex pipeline.

Why this makes VoiceBridge different from IVR-style AI systems

Traditional IVR AI:

  • No real interruption handling.
  • Turn-based audio playback.
  • Caller waits → AI speaks → repeat.

VoiceBridge full-duplex AI:

  • Caller and AI can speak simultaneously.
  • Interruptions are detected in milliseconds.
  • AI audio stops instantly and conversation continues naturally.

Operational tuning for production deployments

  • Keep RTP frame timing consistent (≈20 ms typical).
  • Tune energy threshold based on real PSTN noise.
  • Use consecutive-frame detection to avoid false triggers.
  • Ensure outbound RTP queues fully clear on interruption.

These controls allow VoiceBridge to operate reliably in real call-center telecom environments.

Conclusion

Full-duplex AI voice is impossible without true barge-in. VoiceBridge delivers this by combining:

  • Realtime RTP speech detection
  • Instant outbound audio cancellation
  • Realtime AI truncation control
  • Stable duplex media flow inside Asterisk

This is one of the core innovations that enables human-like AI phone conversations on open-source Asterisk infrastructure.

Try it

Want to see API-driven CRM + Telecom workflows in action? Try the WhatsApp bot or explore the demos.

💬 Try WhatsApp Bot ▶️ Watch CRM YouTube Demos
Tip: Comment “Try the bot” on our YouTube videos to see automation in action.
M
MYLINEHUB Team
Published: 2026-02-09
Quick feedback
Was this helpful? (Yes 0 • No 0)
Reaction

Comments (0)

Be the first to comment.