androidrecognizer-intent

Programmatically changing recognizerintent to recognize a language other than English not working


I tried both of these ways and the google voice web search is still only recognizing English.

Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "ja-JP");
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "ja-JP");

Solution

  • Try

    Intent i = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "ja-JP");