Twilio trail帐户没有语音到文本功能

Twilio trail帐户没有语音到文本功能,twilio,twilio-api,twilio-programmable-voice,Twilio,Twilio Api,Twilio Programmable Voice,我有一个twilio trail的账号。 我想知道trail帐户是否禁用了语音识别功能 我试图用聚集动词捕捉讲话。但它不起作用 谢谢大家! 这里是Twilio开发者福音传道者 我认为这里的问题是,如果来电者在通话过程中开始讲话,系统不会设置为听到来电者的声音 您共享的代码中的TwiML看起来有点像这样: <Response> <Say>Welcome to Twilio, please tell us why you're calling</Say>

我有一个twilio trail的账号。 我想知道trail帐户是否禁用了语音识别功能

我试图用聚集动词捕捉讲话。但它不起作用


谢谢大家!

这里是Twilio开发者福音传道者

我认为这里的问题是,如果来电者在通话过程中开始讲话,系统不会设置为听到来电者的声音

您共享的代码中的TwiML看起来有点像这样:

<Response>
  <Say>Welcome to Twilio, please tell us why you're calling</Say>
  <Gather input="speech" timeout="5" action="https://f2b4fbc1.ngrok.io/asr/test"></Gather>
</Response>
<Response>
  <Gather input="speech" timeout="5" action="https://f2b4fbc1.ngrok.io/asr/test">
    <Say>Welcome to Twilio, please tell us why you're calling</Say>
  </Gather>
</Response>
让我知道这是否有帮助

[编辑]

我还认为,在返回XML时需要设置内容类型。我不是Spring/Java开发人员,但我认为您需要更改以下内容

@RequestMapping(method = RequestMethod.POST, value = "/recordTheSpeech", produces = MediaType.APPLICATION_XML_VALUE)
public ResponseEntity<String> recordTheSpeech() throws IOException {
    Say say = new Say.Builder("Welcome to Twilio, please tell us why you're calling").build();
    Gather gather = new Gather.Builder().input(Gather.Input.SPEECH).timeout(5).action("https://f2b4fbc1.ngrok.io/asr/test").say(say).build();
    VoiceResponse response = new VoiceResponse.Builder().gather(gather).build();

    return new ResponseEntity.ok().body(response.toXml());
}
@RequestMapping(method=RequestMethod.POST,value=“/recordTheSpeech”,products=MediaType.APPLICATION\u XML\u value)
public ResponseEntity记录speech()引发IOException{
Say Say=new Say.Builder(“欢迎来到Twilio,请告诉我们您打电话的原因”).build();
Gather Gather=new Gather.Builder().input(Gather.input.SPEECH)。超时(5)。操作(“https://f2b4fbc1.ngrok.io/asr/test)say(say.build();
VoiceResponse=新建VoiceResponse.Builder().gather(gather.build();
返回新的ResponseEntity.ok().body(response.toXml());
}

当你说它不起作用时,你的确切意思是什么?你尝试过什么,结果如何?谢谢,我有一个号码。我想捕捉一个拨打该号码并讲话的用户的声音。我试着把语音转换成字符串(twilio可以处理语音到文本的部分)。根据twilio的官方文档,它说通过使用动词I可以做到。是的,但是你试过什么,什么意思是它不起作用?好的,这是你的控制器代码。怎么不行?我也试过了。然后我也听到了里面的短语,通话自动结束。不执行与操作url对应的方法。(test())。有三件事我不确定。1.url的格式是否正确?2.通过recordTheSpeech()返回字符串可以吗;因为twilio需要来自我们的web应用程序的TwiML格式的数据。3.因为我有一个电话号码;这会影响这个问题吗?我有另一个想法!您仍然希望
嵌套在
中,但我认为Twilio可能只是以文本形式获得响应。您能否将响应的
内容类型设置为
text/xml
,然后重试?您能否告诉我需要从哪里进行更改?是的,您是正确的,问题在于内容类型@RequestMapping(products=MediaType.APPLICATION\u XML\u VALUE,method=RequestMethod.POST,VALUE=“/recordTheSpeech”)在更改解决问题的内容类型后。非常感谢你。
@RequestMapping(method = RequestMethod.POST, value = "/recordTheSpeech", produces = MediaType.APPLICATION_XML_VALUE)
public ResponseEntity<String> recordTheSpeech() throws IOException {
    Say say = new Say.Builder("Welcome to Twilio, please tell us why you're calling").build();
    Gather gather = new Gather.Builder().input(Gather.Input.SPEECH).timeout(5).action("https://f2b4fbc1.ngrok.io/asr/test").say(say).build();
    VoiceResponse response = new VoiceResponse.Builder().gather(gather).build();

    return new ResponseEntity.ok().body(response.toXml());
}