Glass GDk : Contextual voice commands without the "Ok Glass"
Asked Answered
G

2

1

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.

Geologize answered 21/7, 2014 at 15:46 Comment(0)
S
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.

Scribe answered 22/7, 2014 at 15:45 Comment(2)
Seems legit... Also do you know if it is now possible to have more than 5 items shown in the menu list then ? Because the 5+ word are hide and I can't find a way to do custom view insteadGeologize
Sorry it is not the good place to ask, I did a new question for that : #24893112Geologize
T
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!

Theressa answered 24/7, 2014 at 21:56 Comment(4)
Thanks a lot ! I check a little, it seems really interesting, for now I just wanted to know if it was a possibility proposed by the GDK, but if I really need it I will know how to find it :)Geologize
No problem! If you have any trouble understanding or reusing the code (if you need it) let me know and I'd be happy to help.Theressa
Hi, I'm trying to see if I can use your solution in a similarish project, but I can't get ANY voice recognition to work.Rawinsonde
Hi, I'm trying to see if I can use your solution in a similarish project, but I can't get ANY voice recognition to work. I added "test" to the connectCommands(i added some logic to avoid duplicates, becase the code was initioalizing these commands in both VoiceRecognitionThread.setup() and then in changeVocab()(called from MainActivity.onResume() resulting in duplication, I'm not sure if that's ignored. However, I cannot subsequently hit a breakpoint in onVoiceCommand(or onVoiceAmplitudeChanged). Any help would be appreciated.Rawinsonde
S
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.

Scribe answered 22/7, 2014 at 15:45 Comment(2)
Seems legit... Also do you know if it is now possible to have more than 5 items shown in the menu list then ? Because the 5+ word are hide and I can't find a way to do custom view insteadGeologize
Sorry it is not the good place to ask, I did a new question for that : #24893112Geologize

© 2022 - 2024 — McMap. All rights reserved.