RecognitionListener在软糖冻结,如果没有说过话马上 [英] RecognitionListener in JellyBean Freezes if not spoken to immediately
问题描述
一个语音识别基于应用程序,我的工作非常适用于所有版本的Android从API 8(Android 2.2的)。启动
A speech-recognition based app I am working on works well on all versions of Android starting from API 8 (Android 2.2).
但在一个的Nexus S 4G(安卓4.1.1),RecognitionListener将简单的暂停约1分钟,然后发出通过其<一的ERROR_SERVER href="http://developer.android.com/reference/android/speech/RecognitionListener.html#onError%28int%29">onError()回调。
But on a Nexus S 4G (Android 4.1.1), RecognitionListener will simply halt for about 1 minute, then issue an ERROR_SERVER via its onError() callback.
如果讲的是<一为 1-2 秒内( href="http://developer.android.com/reference/android/speech/RecognitionListener.html#onReadyForSpeech%28android.os.Bundle%29">onReadyForSpeech哔哔),它会表现得正常预期。
If spoken to within 1-2 seconds (of that onReadyForSpeech bleep), it will behave properly as expected.
在什么改变软糖可以解释这种现象?
What changed in JellyBean that could explain this behavior?
更重要的是,有没有办法让它表现得像在旧版本的Android? (即守听,然后发出ERROR_SPEECH_TIMEOUT如果默认内没有说过话的10秒)
More importantly, is there a way to make it behave like in the older versions of Android? (i.e. keep listening, then issue ERROR_SPEECH_TIMEOUT if not spoken to within the default 10 seconds)
推荐答案
我最终使用由 @scriptocalypse 建议的解决方案>
感谢您@scriptocalypse!
Thank you @scriptocalypse!
(我还没有机会尝试通过 @HoanNguyen 提出的解决方案,因为它实现它是一个服务超出了我的小应用程序的范围,但它看起来很有希望。谢谢@HoanNguyen了。)
(I haven't had the chance to try the solution suggested by @HoanNguyen because it implements a service which is beyond the scope of my tiny app, but it looks promising. Thank you @HoanNguyen, too.)
这篇关于RecognitionListener在软糖冻结,如果没有说过话马上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!