Sdílet prostřednictvím


TextToSpeech.Language Property

Definition

Caution

deprecated

Returns a Locale instance describing the language currently being used for synthesis requests sent to the TextToSpeech engine.

[System.Obsolete("deprecated")]
public virtual Java.Util.Locale? Language { [Android.Runtime.Register("getLanguage", "()Ljava/util/Locale;", "GetGetLanguageHandler")] get; }
[<System.Obsolete("deprecated")>]
[<get: Android.Runtime.Register("getLanguage", "()Ljava/util/Locale;", "GetGetLanguageHandler")>]
member this.Language : Java.Util.Locale

Property Value

language, country (if any) and variant (if any) used by the client stored in a Locale instance, or null on error.

Attributes

Remarks

Returns a Locale instance describing the language currently being used for synthesis requests sent to the TextToSpeech engine.

In Android 4.2 and before (API <= 17) this function returns the language that is currently being used by the TTS engine. That is the last language set by this or any other client by a TextToSpeech#setLanguage call to the same engine.

In Android versions after 4.2 this function returns the language that is currently being used for the synthesis requests sent from this client. That is the last language set by a TextToSpeech#setLanguage call on this instance.

If a voice is set (by #setVoice(Voice)), getLanguage will return the language of the currently set voice.

Please note that the Locale object returned by this method is NOT a valid Locale object. Its language field contains a three-letter ISO 639-2/T code (where a proper Locale would use a two-letter ISO 639-1 code), and the country field contains a three-letter ISO 3166 country code (where a proper Locale would use a two-letter ISO 3166-1 code).

This member is deprecated. As of API level 21, please use getVoice().getLocale() (#getVoice()).

Java documentation for android.speech.tts.TextToSpeech.getLanguage().

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