TextToSpeech.SetLanguage(Locale) Method

Definition

Sets the text-to-speech language.

[Android.Runtime.Register("setLanguage", "(Ljava/util/Locale;)I", "GetSetLanguage_Ljava_util_Locale_Handler")]
public virtual Android.Speech.Tts.LanguageAvailableResult SetLanguage (Java.Util.Locale? loc);
[<Android.Runtime.Register("setLanguage", "(Ljava/util/Locale;)I", "GetSetLanguage_Ljava_util_Locale_Handler")>]
abstract member SetLanguage : Java.Util.Locale -> Android.Speech.Tts.LanguageAvailableResult
override this.SetLanguage : Java.Util.Locale -> Android.Speech.Tts.LanguageAvailableResult

Parameters

loc
Locale

The locale describing the language to be used.

Returns

Code indicating the support status for the locale. See #LANG_AVAILABLE, #LANG_COUNTRY_AVAILABLE, #LANG_COUNTRY_VAR_AVAILABLE, #LANG_MISSING_DATA and #LANG_NOT_SUPPORTED.

Attributes

Remarks

Sets the text-to-speech language. The TTS engine will try to use the closest match to the specified language as represented by the Locale, but there is no guarantee that the exact same Locale will be used. Use #isLanguageAvailable(Locale) to check the level of support before choosing the language to use for the next utterances.

This method sets the current voice to the default one for the given Locale; #getVoice() can be used to retrieve it.

Java documentation for android.speech.tts.TextToSpeech.setLanguage(java.util.Locale).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to