Google语音识别超时 [英] Google Speech Recognition timeout

查看:223
本文介绍了Google语音识别超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发基于语音识别的Android应用程序.

直到今天,一切都运转良好,并及时进行,例​​如我将启动我的语音识别器,开始讲话,并且在不超过1或2秒的时间内,应用程序会收到结果.

这是非常可接受的用户体验.

那么今天我必须等待十秒或更长时间才能获得识别结果.

我尝试设置以下EXTRAS,但都没有明显区别

RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS
RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS
RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS

我一直在不断更改自己的应用程序,但是这些更改均与语音识别器无关.

我可以采用任何方法来减少语音识别器从onBeginningOfSpeech()切换到onResults()的时间吗?

这里有一个需要多长时间的例子

07-01 17:50:20.839 24877-24877/com.voice I/Voice: onReadyForSpeech()
07-01 17:50:21.614 24877-24877/com.voice I/Voice: onBeginningOfSpeech()
07-01 17:50:38.163 24877-24877/com.voice I/Voice: onEndOfSpeech()

解决方案

编辑-显然已在2016年8月版中得到修复.您可以此要点来复制其中的许多内容.

您可以使用此 BugRecognitionListener 来解决其中的一些问题.

我已将这些信息直接报告给Now团队,因此他们知道了,但目前尚未解决. Google Now没有外部错误跟踪器,因为它不是AOSP的一部分,所以恐怕您无济于事.

您详细介绍的最新错误使它们的实现无法使用,正如您正确指出的那样,用于控制语音输入时序的参数将被忽略.根据文档:

此外,根据识别器的实现,这些值 可能没有效果.

这是我们应该期待的……

如果您不讲话或发出任何可检测到的声音,则识别将无限期继续.

我目前正在创建一个项目,以复制此新错误以及所有其他错误,我将继续转发并在此处链接.

编辑-我希望我可以创建一种变通办法,使用部分或不稳定结果的检测作为触发来知道用户仍在讲话.他们停止后,我可以在设定的时间段后手动致电recognizer.stopListening().

不幸的是,stopListening()也被破坏了,实际上并没有停止识别,因此没有解决方法.

以上的尝试,直到那时(不调用销毁识别器onResults()时)销毁识别器并仅依靠部分结果,否则无法产生可靠的实现,除非您 解决方案

EDIT - Has apparently been fixed in the August 2016 coming release You can test the beta to confirm.

This is a bug with the release of Google 'Now' V6.0.23.* and persists in the latest V6.1.28.*

Since the release of V5.11.34.* Google's implementation of the SpeechRecognizer has been plagued with bugs.

You can use this gist to replicate many of them.

You can use this BugRecognitionListener to work around some of them.

I have reported these directly to the Now team, so they are aware, but as yet, nothing has been fixed. There is no external bug tracker for Google Now, as it's not part of AOSP, so nothing you can star I'm afraid.

The most recent bug you detail pretty much makes their implementation unusable, as you correctly point out, the parameters to control the speech input timings are ignored. Which according to the documentation:

Additionally, depending on the recognizer implementation, these values may have no effect.

is something we should expect......

The recognition will continue indefinitely if you don't speak or make any detectable sound.

I'm currently creating a project to replicate this new bug and all of the others, which I'll forward on and link here shortly.

EDIT - I was hoping I could create a workaround that used the detection of partial or unstable results as the trigger to know that the user was still speaking. Once they stopped, I could manually call recognizer.stopListening() after a set period of time.

Unfortunately, stopListening() is broken too and doesn't actually stop the recognition, therefore there is no workaround to this.

Attempts around the above, of destroying the recognizer and relying only on the partial results up until that point (when destroying the recognizer onResults() is not called) failed to produce a reliable implementation, unless you're simply keyword spotting.

There is nothing we can do until Google fix this. Your only outlet is to email apps-help@google.com reporting the problem and hope that the volume they receive gives them a nudge.....

这篇关于Google语音识别超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆