Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To switch between languages, just use the Locale you want for the language and set <code>Locale.toString</code> for <code>EXTRA_LANGAUGE</code> in you <code>ACTION_RECOGNIZE_SPEECH</code> intent.</p> <p>To check what languages are available, you need something like this:</p> <pre><code> Intent detailsIntent = new Intent( RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS); LanguageDetailsChecker checker = new LanguageDetailsChecker(); sendOrderedBroadcast(detailsIntent, null, checker, null, Activity.RESULT_OK, null, null); </code></pre> <p>Where LanguageDetailsChecker is a BroadcastReceiver defined as something like this:</p> <pre><code>public class LanguageDetailsChecker extends BroadcastReceiver { private static final String TAG = "LanguageDetailsChecker"; private List&lt;String&gt; supportedLanguages; private String languagePreference; public LanguageDetailsChecker() { supportedLanguages = new ArrayList&lt;String&gt;(); } @Override public void onReceive(Context context, Intent intent) { Bundle results = getResultExtras(true); if (results.containsKey(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE)) { languagePreference = results .getString(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE); } if (results.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)) { supportedLanguages = results .getStringArrayList(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES); } } } </code></pre> <p>All this code is part of <a href="https://github.com/gast-lib/gast-lib/blob/master/library/src/root/gast/speech/LanguageDetailsChecker.java" rel="nofollow">this project</a>.</p>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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