如何让谷歌语音在Android上的背景下连续运行 [英] How to make Google Voice run continually in the background on Android
问题描述
我心里有一个应用程序的想法,但我一直没能找出其中的一部分呢。在谷歌现在在Android上,它为您提供了以下选项进行搜索:
I have a app idea in mind, but I haven't been able to figure out one part yet. In Google Now on Android, it gives you the following options to search:
- 键入搜索
- 点击麦克风说出你的搜索
- 或者只说谷歌,使语音搜索开始。
我想知道他们是如何做#3的工作。我需要有一个关键字,即当所述,发起语音搜索
I'd like to know how they made #3 work. I need to have a keyword, that when said, initiates the voice search.
我想他们有一些类型的后台运行的服务,不断听取语音操作。有谁知道这是如何实现的?
I imagine they have some type of background running service constantly listening for voice actions. Does anyone know how this is achieved?
下面是谷歌现在,应用程序的图像:
Here is a image of the Google Now app:
推荐答案
您可以写一个服务,然后使用 createSpeechRecognizer
在该服务。对于一个完整的服务,code本,你可以在这里找到答案<一href="http://stackoverflow.com/questions/14940657/android-speech-recognition-as-a-service-on-android-4-1-4-2/14950616#14950616">Android语音识别是在Android 4.1及放大器的服务; 4.2
You can write a service and then use createSpeechRecognizer
in that service. For a complete service code for this you can find the answer at Android Speech Recognition as a service on Android 4.1 & 4.2
这篇关于如何让谷歌语音在Android上的背景下连续运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!