Glass GDk : Contextual voice commands without the “Ok Glass”

隐身守侯 提交于 2019-12-18 09:37:29

问题


I have an application with a CardScrollView as activity.

Ok Glass => My App => Ok Glass => Next Page
                  Or  OK Glass => Previous Page

Would it be possible to skip the second "Ok Glass" ?

The best would be to let the Voice Command always activated but I don't know if it's possible.


回答1:


It is currently not possible to trigger contextual voice commands without the "ok glass" cue: the main reasons are to prevent false positive and narrow down the window when the microphone is listening for commands.




回答2:


I actually did this for my Glass app. Take a look here: https://github.com/RIVeR-Lab/google_glass_driver/tree/master/android/RobotManager/src/com/riverlab/robotmanager

You are going to be interested in the VoiceRecognitionThread, Vocabulary, and MessageListActivity.

The functionality you described is implemented in both MessageListActivity and VoiceRecognitionThread.

The vocabulary is just support for multi-layered commands. You only need to worry about it if you plan on using voice commands that could branch off to other commands. For example, in my application I was controlling a robot. Commands could look like "drive forward" "drive forward quickly" "drive forward now" or "drive forward quickly delay five". You can see examples in the xml files here: https://github.com/RIVeR-Lab/google_glass_driver/tree/master/test

Hope this helps!



来源:https://stackoverflow.com/questions/24869216/glass-gdk-contextual-voice-commands-without-the-ok-glass

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