首页 > 解决方案 > Twilio - Speech To Text 缺少收集 SpeechResult

问题描述

我已经开始使用 Twilio Voice 和 twiml 中的收集命令。如 java sdk 文档中所述,我提供了必要的配置。

Gather gather = new Gather.Builder()
                .speechTimeout("auto")
                .language(Gather.Language.EN_US)
                .method(HttpMethod.POST)
                .inputs(Gather.Input.SPEECH)
                .actionOnEmptyResult(true)
                .action(String.format("http://%s/call/speechtotext?sid=%s", headers.getHost().getHostName(), ""))
                .build();

问题是对我的操作 url 的请求正文没有 SpeechResult 属性。我总是得到空的动作,当我设置 .actionOnEmptyResult(False) 时不发送请求。有趣的是,每次我暂停讲话时都会触发空动作。

有人对此有解决方案吗?

标签: javatwiliospeech-to-texttwilio-twiml

解决方案


推荐阅读