Share via


TextToSpeechService.OnGetVoices Method

Definition

Queries the service for a set of supported voices.

[Android.Runtime.Register("onGetVoices", "()Ljava/util/List;", "GetOnGetVoicesHandler")]
public virtual System.Collections.Generic.IList<Android.Speech.Tts.Voice>? OnGetVoices ();
[<Android.Runtime.Register("onGetVoices", "()Ljava/util/List;", "GetOnGetVoicesHandler")>]
abstract member OnGetVoices : unit -> System.Collections.Generic.IList<Android.Speech.Tts.Voice>
override this.OnGetVoices : unit -> System.Collections.Generic.IList<Android.Speech.Tts.Voice>

Returns

A list of voices supported.

Attributes

Remarks

Queries the service for a set of supported voices.

Can be called on multiple threads.

The default implementation tries to enumerate all available locales, pass them to #onIsLanguageAvailable(String, String, String) and create Voice instances (using the locale's BCP-47 language tag as the voice name) for the ones that are supported. Note, that this implementation is suitable only for engines that don't have multiple voices for a single locale. Also, this implementation won't work with Locales not listed in the set returned by the Locale#getAvailableLocales() method.

Java documentation for android.speech.tts.TextToSpeechService.onGetVoices().

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