采用Android语音控制启动我的活动我的、语音、Android

2023-09-14 00:05:43 作者:2.我有孤独与酒

我读this张贴在SO,我已经试过了code,推出自己的语音识别活动。有效!。所以我的问题是,我怎么可以自定义内置的语音命令按钮(硬件)的行动,发动这是我写的,而不是内置的语音搜索的活动?我已经彻底搜查了网,包括本网站。但我无法找到一个解决方案。我知道有人在等具有它!

I have read this post on SO and I have tried the code to launch my own speech recognition activity. It worked!. So my question is that how can I customize the action of the built in voice command button(hardware) to launch the activity which I have written instead of the built in voice search? I have thoroughly searched the net including this website. But I could not find a solution. I know that someone on SO has it!!!

推荐答案

您必须使用 SpeechRecognizer 而不是 RecognizerIntent 。这是一个有点很难使用,但你得到完全控制。

You must use SpeechRecognizer instead of RecognizerIntent. It's a little harder to use, but you get full control.

有关code看到here:

和这里的两种方法之间的差异我