类似的应用发展到"谷歌现在" - 是否有可能使用语音识别无键输入? [英] Development of application similar to "Google now" - is it possible to use voice recognition without key input?

查看:131
本文介绍了类似的应用发展到"谷歌现在" - 是否有可能使用语音识别无键输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发使用 TTS 引擎和语音识别一个很酷的应用程序。到目前为止,这是确定的,但我想要更多。我想创建一个服务,(我觉得服务是正确的方式),这始终是听,当有人说确定谷歌或别的东西时,语音识别开始,像谷歌现在。例如,如果你说确定谷歌现在谷歌开始。我不知道从哪里开始,所以我直接问这里是否有可能。我试图寻找在[这里]这个线程(<一href="http://stackoverflow.com/questions/20312563/listening-for-keywords-at-all-times-like-ok-google-on-4-4">Listening在任何时候都关键字,如[确定谷歌&QUOT;对4.4 )和最后的答案谈到了服务,我想。有人可以帮助我与我的code?

I'm trying to develop a cool application that uses the TTS engine and speech recognition. So far it's ok but I want more. I would like to create a service (I think a service is the right way), that is always "listening" and when someone says "ok google" or something else , the speech recognition starts, like google now. For example, if you say "ok google" google now starts. I don't know where to start so I'm asking directly here if it's possible. I tried looking at this thread [here] (Listening for keywords at all times, like "Ok google" on 4.4) and the last answer talked about a service, as I thought. Can someone help me with my code?

例如,这是code通过点击一个按钮来启动语音识别:

For example this is the code to start speech recognition by tapping a button:

/**
 * Instruct the app to listen for user speech input
 */
private void listenToSpeech() {
    //start the speech recognition intent passing required data
    Intent listenIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    //indicate package
    listenIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());
    //message to display while listening
    listenIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say a word!");
    //set speech model
    listenIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    //specify number of results to retrieve
    listenIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);
    //start listening
    startActivityForResult(listenIntent, VR_REQUEST);
}

你觉得有可能启动 listenIntent 只有声音,没有pressing任何按钮?这就是我的意思。

Do you think it's possible to start that listenIntent only with voice and without pressing any button? This is what i mean.

推荐答案

您可以与的奋斗和

此应用程序使用热词检测为谷歌现在。

this app uses hot word detection as "Google Now".

和有一个由机器人提供的没有这样的API来进行这样的操作。

and there is No such API provided by Android to perform such operation.

不要忘记来发表您的发现。

Don't forget to post your findings.

注意 - 它非常消耗CPU和电池消耗听在后台所有的时间。

Note- its very cpu intensive and battery consuming to listen all the time in background.

这篇关于类似的应用发展到&QUOT;谷歌现在&QUOT; - 是否有可能使用语音识别无键输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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