Note that there are some explanatory texts on larger screens.

plurals
  1. POSpeechRecognizer always recognize in english (on version 4.0.3)
    primarykey
    data
    text
    <p>I have a problem with Android SpeechRecognizer. It works perfectly on Android version 2.3.5 with both English (en-GB) and German (de-DE), but on version 4.0.3 it always recognizes speech in English despite the fact the specified language is German.</p> <p>This is my Intent which is passed to SpeechRecognizer.</p> <pre><code>Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language); intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, mContext.getPackageName()); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1); mRecognizer.startListening(intent); </code></pre> <p>I'm sure that variable is always good (de-DE when I want German etc.).</p> <p>I've also tried to add:</p> <pre><code>intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, language); </code></pre> <p>but it doesn't work either.</p> <p>I'm also sure that German is supported by SpeechRecognizer. I'm using this BroadcastReceiver to get the list of available languages.</p> <pre><code>public class AndroidAvailableLanguagesChecker extends BroadcastReceiver { private List&lt;String&gt; supportedLanguages; public AndroidAvailableLanguagesChecker() { supportedLanguages = new ArrayList&lt;String&gt;(); } @Override public void onReceive(Context context, Intent intent) { Bundle results = getResultExtras(true); if (results.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)) { supportedLanguages = results .getStringArrayList(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES); } } public List&lt;String&gt; getSupportedLanguages() { return supportedLanguages; } } // using broadcast receiver Intent detailsIntent = new Intent( RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS); mChecker = new AndroidAvailableLanguagesChecker(); context.sendOrderedBroadcast(detailsIntent, null, mChecker, null, Activity.RESULT_OK, null, null); </code></pre> <p>Do anyone have an idea why this is not working?</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload