语音API RecognizerIntent - 绕道没赶上。尝试再次说话消息 [英] Speech API RecognizerIntent - Bypass the Didn't catch that. try speaking again message

查看:153
本文介绍了语音API RecognizerIntent - 绕道没赶上。尝试再次说话消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了RecognizerIntent并呼吁谷歌的语音识别服务,并能正常工作,我得到的结果。但是,有时如果我咕哝还是我太远离我的设备我得到的消息,没赶上。尝试再说一次。信息。有没有一种方法可以绕过这一点,并没有显示此消息,因为我不希望用户有preSS确定继续?

I have implemented the RecognizerIntent and called google's voice recognition service and it works fine and i get results. However, sometimes if i mumble or am too far away from my device i get the message "Didn't catch that. Try speaking again." message. Is there a way to bypass this and not show this message as i don't want the users to have to press OK to continue?

感谢

推荐答案

使用 SpeechRecognizer如果你想成为在UI的控制。

Use SpeechRecognizer if you want to be in control of the UI.

如果我理解正确的话,那么你正在启动 RecognizerIntent ,这被通过在谷歌搜索应用中的活动之一(或谷歌语音搜索,或者,随便处理被称为目前)。现在,因为这是一个的活动的,它需要在用户界面,也就是说,它会弹出一个对话框,显示提示信息和VU表等。在一个错误条件的情况下,它可以原则通过发送错误codeS如一个控制返回给你的应用程序 RESULT_NO_MATCH (如文档建议),但选择不。相反,它会弹出一个再试一次的消息。返回到您的活动唯一方法是pressing BACK,或希望识别成功。

If I understand correctly then you are launching the RecognizerIntent and this gets handled by one of the activities in the Google Search app (or Google Voice Search, or whatever it happens to be called currently). Now, since this is an activity, it takes over the UI, i.e. it pops up a dialog box, shows a prompt and a VU meter, etc. In case of an error condition, it could in principle return control to your app by sending one of the error codes e.g. RESULT_NO_MATCH (as the documentation suggests), but it chooses not to. Instead it pops up a "try again" message. The only way to return to your activity is by pressing BACK, or hoping that the recognition succeeds.

如果你想控制更多的用户体验,然后使用 SpeechRecognizer 。这样,你是调用的服务的,然后通过回调与之交互。您将在用户界面的完全控制。或差不多,例如谷歌的应用程序,使蜂鸣当识别开始,有没有办法将其关闭,并提供自己的蜂鸣声。

If you want to control more of the user experience then use SpeechRecognizer. This way your are calling a service and then interact with it via callbacks. You will be in full control of the UI. Or almost, e.g. the Google app makes a beep when the recognition starts, and there is no way to turn it off and provide your own beep.

请注意,这个答案是特定的(到特定版本),谷歌的语音识别服务,这是不正确的Andr​​oid的一部分。它实现了 RecognizerIntent / SpeechRecognizer API的一部分,但它的不同版本的API覆盖面和它们的确切行为有所不同。所以,这个答案有可能成为错误的未来。

Note that this answer is specific (to a specific version) of Google's voice recognition service which is not part of Android proper. It implements part of the RecognizerIntent/SpeechRecognizer API but its different versions differ in the API coverage and their exact behavior. So this answer might become wrong in the future.

这篇关于语音API RecognizerIntent - 绕道没赶上。尝试再次说话消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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