如何防止用户';当系统说话时,Twilio的语音输入?

如何防止用户';当系统说话时,Twilio的语音输入?,twilio,Twilio,当系统说话时,如何防止用户对Twilio的语音输入? 我有一个长文本,之后应该会有用户的语音输入。但是,当用户在系统读取长文本时讲话时,阅读被中断。我需要用户听文本直到结束,然后才准备好语音输入 有可能在暮色中这样做吗 以下是我返回的XML响应: `<Response> <Gather input="speech" action="MyControllername/MyMethodName" speechTimeout="auto"> <Say>H

当系统说话时,如何防止用户对Twilio的语音输入? 我有一个
长文本
,之后应该会有用户的语音输入。但是,当用户在系统读取长文本时讲话时,阅读被中断。我需要用户听文本直到结束,然后才准备好语音输入

有可能在暮色中这样做吗

以下是我返回的XML响应:

`<Response>
  <Gather input="speech" action="MyControllername/MyMethodName" speechTimeout="auto">
    <Say>Here is my very long confidential text</Say>
  </Gather>
  <Redirect>/MyControllername/IncorrectOrNoInputMethod</Redirect>
</Response>
`
`
这是我很长的机密文本
/MyControllername/IncorrectOrNoInputMethod
`
代码如下:

`public async Task<TwiMLResult> MyMethodName()
        {
            var response = new VoiceResponse();
            var message = await _logic.GetMyLongText(); // This test I get from BL, it is an async method
            var gather = new Gather(new [] {Gather.InputEnum.Speech}.ToList(), Url.ActionUri(nameof(AnotherMethodName), ControllerName), speechTimeout: "auto");
            gather.Append(new Say(message));
            response.Append(gather);
            response.Redirect(Url.ActionUri(nameof(IncorrectOrNoInputMethod), ControllerName));
            return TwilioResultFrom(response);
}`
公共异步任务MyMethodName() { var response=新的VoiceResponse(); var message=await _logic.GetMyLongText();//我从BL得到的这个测试,它是一个异步方法 var gather=new gather(new[]{gather.inpunum.Speech}.ToList(),Url.ActionUri(nameof(AnotherMethodName),ControllerName),speechTimeout:“auto”); 收集。附加(新的说(消息)); 响应。追加(收集); 重定向(Url.ActionUri(nameof(IncorrectOrNoInputMethod),ControllerName)); 返回TwiliorResultFrom(响应); }`
这里是Twilio福音传道者

你需要让Say动词出现在聚集之前:

<Response>
  <Say>Here is my very long confidential text</Say>
  <Gather input="speech" action="MyControllername/MyMethodName" speechTimeout="auto">
  </Gather>
  <Redirect>/MyControllername/IncorrectOrNoInputMethod</Redirect>
</Response>

希望有帮助。

你能分享你正在生成的TwiML吗?我已经更新了帖子以包含你的请求。
public async Task<TwiMLResult> MyMethodName()
{
    var response = new VoiceResponse();
    var message = await _logic.GetMyLongText(); // This test I get from BL, it is an async method
    response.Say(message);
    var gather = new Gather(new [] {Gather.InputEnum.Speech}.ToList(), Url.ActionUri(nameof(AnotherMethodName), ControllerName), speechTimeout: "auto");
    response.Append(gather);
    response.Redirect(Url.ActionUri(nameof(IncorrectOrNoInputMethod), ControllerName));
    return TwilioResultFrom(response);
}