TextToSpeechService.OnLoadVoice(String) Method

Definition

Notifies the engine that it should load a speech synthesis voice.

[Android.Runtime.Register("onLoadVoice", "(Ljava/lang/String;)I", "GetOnLoadVoice_Ljava_lang_String_Handler")]
public virtual Android.Speech.Tts.OperationResult OnLoadVoice (string? voiceName);
[<Android.Runtime.Register("onLoadVoice", "(Ljava/lang/String;)I", "GetOnLoadVoice_Ljava_lang_String_Handler")>]
abstract member OnLoadVoice : string -> Android.Speech.Tts.OperationResult
override this.OnLoadVoice : string -> Android.Speech.Tts.OperationResult

Parameters

voiceName
String

Name of the voice.

Returns

TextToSpeech#ERROR or TextToSpeech#SUCCESS.

Attributes

Remarks

Notifies the engine that it should load a speech synthesis voice. There is no guarantee that this method is always called before the voice is used for synthesis. It is merely a hint to the engine that it will probably get some synthesis requests for this voice at some point in the future.

Will be called only on synthesis thread.

The default implementation creates a Locale from the voice name (by interpreting the name as a BCP-47 tag for the locale), and passes it to #onLoadLanguage(String, String, String).

Java documentation for android.speech.tts.TextToSpeechService.onLoadVoice(java.lang.String).

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