0
votes

I am going to get results of speech recognition from Google glass accourding the tutorial in https://developers.google.com/glass/develop/gdk/voice website. The RecognizerIntent returns a list but with only one member for Glass and more members for Android phone!

Any idea how to get more results from voice recognition in Google glass!

Here is some part of the code(according to this tutorial):

private static final int SPEECH_REQUEST = 0;

private void displaySpeechRecognizer() {
    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    startActivityForResult(intent, SPEECH_REQUEST);
}

@Override
protected void onActivityResult(int requestCode, int resultCode,Intent data) {
if (requestCode == SPEECH_REQUEST && resultCode == RESULT_OK) {
    List<String> results = data.getStringArrayListExtra(
            RecognizerIntent.EXTRA_RESULTS);
    String spokenText = results.get(0);
    // Do something with spokenText.
}
super.onActivityResult(requestCode, resultCode, data);
}

Some extra information about this program:

android:minSdkVersion="19"
android:targetSdkVersion="19"
compile with: Android 4.4.2 (API 19) SDK
1
Are you saying you get more recognition results for the same spoken speech on an Android device? - Koh
Yes, I get only one result in glass and more results on an Android device! - kian mobini
The topmost result is usually the most relevant based on speech recognizer confidence scores. Check that your RecognizerIntent extras are the same. If you are able to reproduce the issue consistently, consider filing a report on the Glass issue tracker. - Koh

1 Answers

0
votes

What do you mean by "members"? Can you add the text that is captured from the SpeechRecognizer on both Glass and Android phone?