Create “ok glass” style menu, within glass app

后端 未结 4 1112
慢半拍i
慢半拍i 2021-02-02 03:08

I have just begun developing for Google Glass, and I knew the GDK if fairly new so this may not be possible yet, but here\'s what I\'m trying to to:

As with the \"make a

4条回答
  •  别跟我提以往
    2021-02-02 03:42

    You can call an intent to display the Voice Recognizer after your Activity has started. So, you could have your voice trigger and prompt from the launch, and then, in your Activity's onResume(), call the Voice Recognizer, with some kind of prompt (or you could just string the initial speech collected into this as the prompt):

        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra( RecognizerIntent.EXTRA_PROMPT, "ok glass, here's my prompt" );
        startActivityForResult(intent, 0);
    

    You then would need an onActivityResult() method to process the return form the VoiceRecognizer.

    This is the described in the GDK docs: https://developers.google.com/glass/develop/gdk/input/voice

    Not sure if there is any other way.

提交回复
热议问题