Android: Listen for a voice command (all the time)

血红的双手。 提交于 2019-12-21 16:38:56

问题


I have a fairly popular application in Android market, which allows tens of thousands of its users to press a button and give it a voice command. Then I am able to do many different things, like give them current weather forecast, etc...

Anyhow, I came to a point where am getting asked almost every day by users of my app, that they don't want to be pressing a button all the time. They want my app to launch by a trigger word (some specific word command). In that way, app would wake up and ask them for a voice command, all hands free.

I understand that this would require a nonstop listening, it could be a battery eater, etc. But I want to give it a try. Anyhow, and this is why I am here. I simply don't know how to go about it.

I know it's possible, these guys did it and not only that, they listen to a trigger word even when the phone is in the sleeping mode or behind a locked screen: http://www.youtube.com/watch?v=Dd2vo_9euOY

Any ideas on how this could be done? How did the guys above do it? How? Any examples?

Thanks in advance.


回答1:


NoiseAlert is an Application that launches when there is a loud ambient noise, it pays attention to the noise amplitude and also contains wakelocks.

You may use this as an reference. I think you have already implemented the Speeck recognition part.



来源:https://stackoverflow.com/questions/8206379/android-listen-for-a-voice-command-all-the-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!