在语音命令上启动应用程序(android) [英] Launch app on voice command (android)
问题描述
我需要一个示例,说明如何通过语音命令(触发词)启动我的应用程序. 因此,某种在后台运行的服务会监听所有内容,如果单词与设置的文本值匹配(我想这可以通过语音识别来完成),则应用会打开.我知道这是可能的,但我不知道从哪里开始...
I need an example of how I could launch my app on a voice command (trigger word). So some sort of a service running in the background listening to everything and if the word matches a set textual value (I guess this can be done through Voice Recognition), app will open. I know this is possible, but I've no clue where to start...
我看到其他应用也可以建立此功能.我的用户接近100万,这是最常被要求使用的功能之一.
I see other apps are able to establish this. I've close to 1 million users and this is one of the most often requested features.
推荐答案
为此,您必须将Android语音识别作为服务而非活动来运行.然后让您的服务收听关键字或词组.
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.
查看此git以获取有关如何将Android语音识别作为服务运行的示例代码:
Check out this git for example code on how to run Android speech recognition as a service:
https://github.com/gast-lib/gast-lib/
这篇关于在语音命令上启动应用程序(android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!