Using Android Speech Recognition APIs from Google Glass
Asked Answered
L

2

14

I'm working to adapt an existing Android application to run on Google Glass, as a proof of concept. I would like to use voice input in my application to replace some features that currently require touch input.

I can deploy my APK to Google Glass and run it without a problem (through ADB), but once it's running, neither Android speech recognition API I've tried works on Glass:

startActivityForResult(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH));

This results in an ActivityNotFoundException ("no activity found to handle intent") when running on Google Glass

SpeechRecognizer.IsRecognitionAvailable(context);

This always returns false on Google Glass.

I'm curious if anyone else has run into these issues or has any suggestions.

Listless answered 1/7, 2013 at 21:46 Comment(2)
have you been able to fix this? Is there a voice recognition API on Glass yet?Gelasias
You could be sneaky and create a web view, managing speech recognition like so: updates.html5rocks.com/2013/01/…. Alternatively you can unofficially use Google's web speech recognition API.Embryonic
P
9

To use the standard android speech recognition you have to install/deploy the com.google.android.voicesearch apk package.

I don't know if there is an official way to get this. I just googled the apk file.

Just install it by using adb install < apk-file >

Then you should be able to use the voice recognition feature of android on your glass device.


Another way is to use the very cool features of google glass, e.g. to just say "okay glass" to activate the voice recognition.

But therefore you have to root your device and activate this so called lab-feature.

This side is a good starting point for the activation of lab features: glassxe

I have not tried it by myself but I am going to.

Procambium answered 6/8, 2013 at 20:41 Comment(3)
Great it worked with the ICS VoiceSearch.apk not with the older version of Voicesearch.apks Thank You So much...!Thralldom
@AmalanDhananjayan Where do you get the VoiceSearch.apk for ICS? I just found a 2.1.4 version. I used VoiceSearch 2.1.4 but it always return null result for me.Sutlej
@AmalanDhananjayan Never mind, 2.1.4 should enough. I did not change the miniSDK to 15.Sutlej
G
5

It should be noted that now RecognizerIntent.ACTION_RECOGNIZE_SPEECH just works on Glass and does not require the com.google.android.voicesearch package. If you have installed it, you should uninstall it and use the built-in support.

Gillam answered 10/10, 2013 at 19:26 Comment(3)
Having some wierd behavior. I launch speech recognizer with intent and it immediately returns before speaking. No data is returned...Antiphrasis
'RecognizerIntent' is not always suitable... I've created an issue/request for SpeechRecognizer code.google.com/p/google-glass-api/issues/detail?id=245 please star if interestedLaszlo
Tony Allevato thank you very much for your answer. If I want to authenticate the voice of user via google glass what approach you will prefer? [VOICE AUTHENTICATION on google glass]Ebb

© 2022 - 2024 — McMap. All rights reserved.