Matt Ross
Matt Ross

Reputation: 21

Creating a form that accepts voice input on Google Glass

Does anyone know if any Glassware has the ability to allow a user to fill in a form via voice input? Or even if there's some kind of plugin that allows voice input on the browser? If not, is there any particular reason why this isn't possible?

I'm looking for examples where Glassware accepts voice input for textfields on a form. I've used my Google Glass to navigate to a website and can select an input field like a search box but then it doesn't seem possible to input anything into the textfield and I see no examples online where anyone has done this.

Conceptually, it seems like it should be relatively straight forward as input fields can be selected and the voice-to-text has been covered fairly well, so it seems reasonable that the resulting text can then be set as the value of the input box, right?

Upvotes: 1

Views: 424

Answers (1)

AniV
AniV

Reputation: 4037

For this you have to make use of the unlisted contextual voice commands. The only issue with this method is you have to declare all your text fields as the menu items:

Create the XML

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Use the constants defined in the ContextualMenus.Command enum-->
    <item
        android:id="@+id/pizza_menu_item"
        android:title="@string/find_pizza" />
</menu>

And then start the speech recognition. You need to call the startActivityForResult() with the ACTION_RECOGNIZE_SPEECH intent with the EXTRAS if required. And overrifr the on ActivityResult() callback to receive the trascribed text from thr EXTRA_RESULT that you are going to fill in your text fields. For the code please follow the instructions in this Google Doc.

Upvotes: 1

Related Questions