Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Glass/GDK based VoiceListener only catch VoiceCommand once in XE16?

In search for a way to implement contextual voice commands with Google's GDK i came across this post. Yet, the example code seems to work only in XE12 not in XE16+. I tested this code recently, but the onVoiceCommand(...) method is only called once in the lifetime of a related Activity. My expectation would be that a user's voice command can be obtained multiple times, i.e., if a user returns to a certain Activity from another one.

I even tried to remove and reattach the Activity and/or Listener to the GDKs built-in VoiceInputHelper when the Activity is backgrounded via the onPause(...) and onResume(...) method, yet no success. Any helpful ideas why VoiceCommands are "gone" after one event and how they can be "reenabled"?

I can test your ideas/solutions as I have a Glass device at hand, and I verify any input rapidly.

like image 512
MWiesner Avatar asked May 03 '14 06:05

MWiesner


1 Answers

The original example in at stackoverflow.com/questions/21168267 needs a small change: to work continously null needs to be returned in onVoiceCommand().

like image 56
pscholl Avatar answered Oct 03 '22 00:10

pscholl