You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Twilio bargeIn参数能否打断TTS?<Say>后<Gather>配置疑问

Twilio bargeIn 参数使用说明

核心结论

  • bargeIn="true" 仅能打断**组件内部**的TTS播报,无法打断独立的组件的语音输出。你当前的配置场景确实不被支持。

原因解释

Twilio的bargeIn参数是专门为设计的,只有当内部包含(或使用say属性)时,开启bargeIn才能让呼叫者打断这段播报并触发语音采集。独立的组件在播放时,Twilio不会监听呼叫者的输入,因此无法被打断。

正确配置示例

如果需要允许用户打断播报并立即采集语音,必须把播报内容放到内部:

<?xml version="1.0" encoding="utf-8"?>
<Response>
    <Gather input="speech" action="https://myserver/api/v1/webhooks/twilio" timeout="3" speechTimeout="auto" language="en-US" bargeIn="true" speechModel="phone_call" enhanced="true">
        <Say voice="Polly.Matthew-Neural" language="en-US">This is a whole lot of instructions to give the person on the other end of the call. etc...</Say>
    </Gather>
</Response>

这样配置后,呼叫者在播报过程中说话时,Twilio会立即终止播报,开始采集语音并将结果发送到指定的action地址。

内容的提问来源于stack exchange,提问作者Bron Davies

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 16:12:36