niteshmourya / app-inventor-for-android

Automatically exported from code.google.com/p/app-inventor-for-android
Apache License 2.0
2 stars 0 forks source link

allow RecognizerIntent.EXTRA_RESULTS to be set so SpeechRecognizer can return more than one result #2017

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The android speech recognizer has many configuration options.
The most important are LANGUAGE_MODEL_FREE_FORM, which may be the
default on Appinventor and EXTRA_RESULTS which allows the application
to choose the best string from a set of strings returned by
the recognizer, rather than just accepting the one possible string
that the recognizer scored best.

Would it be possible to make these options available thru App Inventor?

http://code.google.com/p/app-inventor-for-android/source/browse/trunk/src/compon
ents/runtime/components/android/SpeechRecognizer.java?r=49

has some code that looks like it would do the right thing

 @Override
  public void resultReturned(int requestCode, int resultCode, Intent data) {
    Log.i("VoiceRecognizer",
        "Returning result. Request code = " + requestCode + ", result code = " + resultCode);
    if (requestCode == this.requestCode && resultCode == Activity.RESULT_OK) {
      if (data.hasExtra(RecognizerIntent.EXTRA_RESULTS)) {
        ArrayList<String> results;
        results = data.getExtras().getStringArrayList(RecognizerIntent.EXTRA_RESULTS);
        result = results.get(0);
      } else {
        result = "";
      }
      AfterGettingText(result);
    }

if only there were a way to set RecognizerIntent.EXTRA_RESULTS

Original issue reported on code.google.com by ginsparg...@gmail.com on 7 Mar 2012 at 8:49

GoogleCodeExporter commented 9 years ago

Original comment by weihuali...@gmail.com on 14 Mar 2012 at 4:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
someone has been able to change the input language?

Original comment by paual...@gmail.com on 21 Aug 2012 at 6:31