Reputation: 539
I implemented SpeechRecognizer in Android Wear but this UI looks same as 'Ok Google' ui thus confuses user believing that they are talking to our app in fact they are talking to 'Ok Google' UI.
Is there a way to customize the SpeechRecognizer UI so that we can avoid this confusion?
Upvotes: 3
Views: 873
Reputation: 11
Sure, it's possible to use a custom ui. Create one, show it and run the recognizer from code
sr = SpeechRecognizer.createSpeechRecognizer(getApplicationContext());
sr.setRecognitionListener(new Speachlistener());
if (recognizerIntent == null) {
recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
//intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getApplication().getPackageName());
recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);
}
try{
sr.startListening(recognizerIntent);
}catch (Exception e)
{}
Upvotes: 1
Reputation: 3431
Currently I don't think so. When I try it I get this error message "SpeechRecognizer﹕ no selected voice recognition service". Looking at Google Glass it seems that based on this information it's not available but may become so. Hopefully this is also true for Android Wear.
Is it possible to have Android Voice Recognition (as a custom service) on Google Glass?
Upvotes: 1