Implementing Barge-In with UniMRCP + Asterisk

31 views
Skip to first unread message

Fernando Lopes

unread,
Nov 20, 2025, 11:23:16 AMNov 20
to UniMRCP
Hello everyone,

I’m trying to implement barge-in in my current setup. Right now, I’m only able to achieve a limited version using Asterisk, where the TTS playback is interrupted only after the entire prompt has been prepared and is about to be sent to the user.
This doesn’t allow true real-time barge-in during synthesis.

Does anyone have suggestions on how to properly implement barge-in with UniMRCP?
Any documentation, examples, or guidance on the correct approach would be greatly appreciated.

Thank you!

Vahagn Kocharyan

unread,
Dec 5, 2025, 9:39:01 PMDec 5
to UniMRCP
How “proper” MRCP barge-in works

At MRCP level, proper barge-in is:

  1. Start TTS with SPEAK 

  2. In parallel, start ASR with RECOGNIZE and barge-in-enabled + VAD on.

  3. When the recognizer detects user speech, MRCP sends a start-of-input / start-of-speech event.

  4. Either:

    • the server itself stops TTS because Kill-On-Barge-In is true, or

    • the client (Asterisk) sends a STOP for the ongoing SPEAK.

The UniMRCP Asterisk module wraps this logic in SynthAndRecog() so you don’t have to do it manually. When barge-in occurs, the synth session is stopped and ASR keeps processing the live audio. UniMRCP+1

What you have now (“interrupt only once the prompt is fully prepared”) usually means TTS is rendered to a file/buffer first and only then streamed as a normal playback – Asterisk can only stop that at file boundaries, not in true streaming fashion.

Reply all
Reply to author
Forward
0 new messages