Launch app on voice command (android)

旧城冷巷雨未停 提交于 2019-11-29 11:03:49

To do this you have to run Android speech recognition as a service instead of as an activity. Then have your service listen for the key word or phrase.

Check out this git for example code on how to run Android speech recognition as a service:

https://github.com/gast-lib/gast-lib/

Google has just introduced a new voice interaction API from android M. You can checkout the video here, http://www.youtube.com/watch?v=OW1A4XFRuyc&list=PLOU2XLYxmsIJDPXCTt5TLDu67271PruEk

On Android 6 and later, you can just say "Ok Google" or click on the microphone icon, then say "launch YourAppName", and your app will be launched.

If Google voice search cannot recognize your app's name, try to spell it out.

To turn on "Ok Google" voice search: https://support.google.com/websearch/answer/2940021?hl=en

Hope that helps!

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