Android的 - 意图为自定义语音操作 [英] Android - Intent for custom voice action

查看:167
本文介绍了Android的 - 意图为自定义语音操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用谷歌语音搜索,我可以说发送文本和谷歌将推出我的SMS程序。

When I use google voice search, I can say "Send Text" and google will launch my SMS program.

我可以说,听和谷歌将开始我的默认的音乐应用程序。

I can say "Listen to" and google will start my default music app.

是否有可能为我的应用程序将其注册自己的特殊短语,如:MyApp的的DoSomething,然后让谷歌推出的MyApp与DoSomething的作为一种类型的参数,我可以捕获并做一些与

Is it possible for my app to register it's own "special phrase" such as: "MyApp DoSomething" and then have google launch MyApp with the "DoSomething" as a type of parameter I can capture and do something with?

要稍微多一点明确的 - 我知道,用户可以启动MyApp的,然后我可以提供一个启动语音输入的动作,但我想谷歌的语音搜索应用程序,以便能够开始我当某些关键短语是口语的应用程序。

To be a little bit more clear - I'm aware that the user can launch MyApp, then I can provide an action that starts the Voice Input, but I'd like the google voice search app to be able to start my application when certain key phrases are spoken.

推荐答案

据我所知,你希望谷歌语音搜索应用程序,当你说一个特殊的密码来启动应用程序。我认为,在present目前有没有可能添加功能的谷歌语音搜索应用程序(也就是这个没有API)。

As I understand you want Google Voice Search application to launch your application when you say a special key phrase. I think that at the present moment there is no possibility to add your functionality in the Google Voice Search application (there is no API for this).

不过,可以实现通过以下方式你自己的语音搜索应用程序:

However, you can implement your own Voice Search application in the following way:

  1. 您可以创建一个AppWidget,并把它放在桌面上。
  2. 在当前这个AppWidget用户点击,你可以打电话给你的服务, 从这个服务的推出语音识别的活动。
  3. 在此活动将返回识别结果 (<一href="http://developer.android.com/resources/articles/speech-input.html">http://developer.android.com/resources/articles/speech-input.html) 它可以在服务处理。在此期间,你可以比较 识别与你的结果predefined字符串 应用程序启动,如果有一个匹配,那么你可以简单地 拨打需要的应用程序。
  1. You can create an AppWidget and put it on the desktop.
  2. When a user click on this AppWidget you can call your service and from this service launch voice recognition activity.
  3. This activity will return the result of the recognition (http://developer.android.com/resources/articles/speech-input.html) which can be processed in the service. During this you can compare a result of the recognition with yours predefined strings for application launching and if there is a match then you can simply call needed application.

这篇关于Android的 - 意图为自定义语音操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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