Synthesizer BARGE-IN-OCCURRED

The BARGE-IN-OCCURRED method lets the client notify the synthesizer that a barge-in event has occurred, so it can stop speaking.

It is used in two scenarios:

  1. The client has detected a barge-in-able event—DTMF digits, for example—and wants to communicate it to the synthesizer.
  2. The recognizer and synthesizer resources are on different servers. Here the client must act as a proxy: it receives the event from the recognition resource and sends a BARGE-IN-OCCURRED method to the synthesizer, carrying the Proxy-Sync-Id header field received from the resource that generated the original event.

If a SPEAK request is active with kill-on-barge-in enabled and BARGE-IN-OCCURRED is received, the synthesizer stops streaming audio. It also terminates any SPEAK requests queued behind the active one, whether or not they have barge-in enabled. When a barge-in-able prompt is terminated, the response lists the request-ids of all terminated SPEAK requests in its Active-Request-Id-List header field, and no SPEAK-COMPLETE events are generated for them.

When the synthesizer and recognizer are on the same server, they can be optimized for a faster kill-on-barge-in response by interacting directly over a common RTSP session-id. In that case the client still proxies the recognition event through a BARGE-IN-OCCURRED method, but the synthesizer may already have stopped and sent a SPEAK-COMPLETE event with a barge-in completion-cause. If no SPEAK requests were terminated as a result, the response is still a 200 (Success) but contains no Active-Request-Id-List header field.


MRCPv1 example

A SPEAK is in progress when the client proxies a barge-in event (note the Proxy-Sync-Id); the response lists the terminated SPEAK in Active-Request-Id-List:

  C->S:  SPEAK 543258 MRCP/1.0
Voice-gender:female
Prosody-volume:medium
Content-Type:application/synthesis+ssml
Content-Length:104

<?xml version="1.0"?>
<speak>
<paragraph>
<sentence>You have 4 new messages.</sentence>
<sentence>The first is from <say-as
type="name">Stephanie Williams</say-as>
and arrived at <break/>
<say-as type="time">3:45pm</say-as>.</sentence>
<sentence>The subject is <prosody
rate="0.8">ski trip</prosody></sentence>
</paragraph>
</speak>

S->C: MRCP/1.0 543258 200 IN-PROGRESS

C->S: BARGE-IN-OCCURRED 543259 MRCP/1.0
Proxy-Sync-Id:987654321

S->C: MRCP/1.0 543259 200 COMPLETE
Active-Request-Id-List:543258

MRCPv2 example

The same exchange in MRCPv2, with the Channel-Identifier and Speech-Marker headers:

   C->S: MRCP/2.0 ... SPEAK 543258
Channel-Identifier:32AECB23433802@speechsynth
Voice-gender:female
Prosody-volume:medium
Content-Type:application/ssml+xml
Content-Length:...

<?xml version="1.0"?>
<speak version="1.0"
xmlns="http://www.w3.org/2001/10/synthesis"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
xml:lang="en-US">
<p>
<s>You have 4 new messages.</s>
<s>The first is from Stephanie Williams and arrived at
<break/>
<say-as interpret-as="vxml:time">0342p</say-as>.</s>
<s>The subject is
<prosody rate="0.8">ski trip</prosody></s>
</p>
</speak>

S->C: MRCP/2.0 ... 543258 200 IN-PROGRESS
Channel-Identifier:32AECB23433802@speechsynth
Speech-Marker:timestamp=857206027059

C->S: MRCP/2.0 ... BARGE-IN-OCCURRED 543259
Channel-Identifier:32AECB23433802@speechsynth
Proxy-Sync-Id:987654321

S->C: MRCP/2.0 ... 543259 200 COMPLETE
Channel-Identifier:32AECB23433802@speechsynth
Active-Request-Id-List:543258
Speech-Marker:timestamp=857206039059

Related articles


Was this article helpful?