TextToSpeech.Speak Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Speak(String, QueueMode, IDictionary<String,String>) |
Obsolete.
Speaks the string using the specified queuing strategy and speech parameters. |
Speak(ICharSequence, QueueMode, Bundle, String) |
Speaks the text using the specified queuing strategy and speech parameters, the text may be spanned with TtsSpans. |
Speak(String, QueueMode, Bundle, String) |
Speaks the text using the specified queuing strategy and speech parameters, the text may be spanned with TtsSpans. |
Speak(String, QueueMode, IDictionary<String,String>)
Caution
deprecated
Speaks the string using the specified queuing strategy and speech parameters.
[Android.Runtime.Register("speak", "(Ljava/lang/String;ILjava/util/HashMap;)I", "GetSpeak_Ljava_lang_String_ILjava_util_HashMap_Handler")]
[System.Obsolete("deprecated")]
public virtual Android.Speech.Tts.OperationResult Speak (string? text, Android.Speech.Tts.QueueMode queueMode, System.Collections.Generic.IDictionary<string,string>? params);
[<Android.Runtime.Register("speak", "(Ljava/lang/String;ILjava/util/HashMap;)I", "GetSpeak_Ljava_lang_String_ILjava_util_HashMap_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member Speak : string * Android.Speech.Tts.QueueMode * System.Collections.Generic.IDictionary<string, string> -> Android.Speech.Tts.OperationResult
override this.Speak : string * Android.Speech.Tts.QueueMode * System.Collections.Generic.IDictionary<string, string> -> Android.Speech.Tts.OperationResult
Parameters
- text
- String
The string of text to be spoken. No longer than
#getMaxSpeechInputLength()
characters.
- queueMode
- QueueMode
The queuing strategy to use, #QUEUE_ADD
or #QUEUE_FLUSH
.
- params
- IDictionary<String,String>
Parameters for the request. Can be null.
Supported parameter names:
Engine#KEY_PARAM_STREAM
,
Engine#KEY_PARAM_UTTERANCE_ID
,
Engine#KEY_PARAM_VOLUME
,
Engine#KEY_PARAM_PAN
.
Engine specific parameters may be passed in but the parameter keys
must be prefixed by the name of the engine they are intended for. For example
the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the
engine named "com.svox.pico" if it is being used.
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the speak operation.
- Attributes
Remarks
Speaks the string using the specified queuing strategy and speech parameters. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
) and using the Engine#KEY_PARAM_UTTERANCE_ID
parameter.
This member is deprecated. As of API level 21, replaced by #speak(CharSequence, int, Bundle, 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
Speak(ICharSequence, QueueMode, Bundle, String)
Speaks the text using the specified queuing strategy and speech parameters, the text may be spanned with TtsSpans.
[Android.Runtime.Register("speak", "(Ljava/lang/CharSequence;ILandroid/os/Bundle;Ljava/lang/String;)I", "GetSpeak_Ljava_lang_CharSequence_ILandroid_os_Bundle_Ljava_lang_String_Handler")]
public virtual Android.Speech.Tts.OperationResult Speak (Java.Lang.ICharSequence? text, Android.Speech.Tts.QueueMode queueMode, Android.OS.Bundle? params, string? utteranceId);
[<Android.Runtime.Register("speak", "(Ljava/lang/CharSequence;ILandroid/os/Bundle;Ljava/lang/String;)I", "GetSpeak_Ljava_lang_CharSequence_ILandroid_os_Bundle_Ljava_lang_String_Handler")>]
abstract member Speak : Java.Lang.ICharSequence * Android.Speech.Tts.QueueMode * Android.OS.Bundle * string -> Android.Speech.Tts.OperationResult
override this.Speak : Java.Lang.ICharSequence * Android.Speech.Tts.QueueMode * Android.OS.Bundle * string -> Android.Speech.Tts.OperationResult
Parameters
- text
- ICharSequence
The string of text to be spoken. No longer than
#getMaxSpeechInputLength()
characters.
- queueMode
- QueueMode
The queuing strategy to use, #QUEUE_ADD
or #QUEUE_FLUSH
.
- params
- Bundle
Parameters for the request. Can be null.
Supported parameter names:
Engine#KEY_PARAM_STREAM
,
Engine#KEY_PARAM_VOLUME
,
Engine#KEY_PARAM_PAN
.
Engine specific parameters may be passed in but the parameter keys
must be prefixed by the name of the engine they are intended for. For example
the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the
engine named "com.svox.pico" if it is being used.
- utteranceId
- String
An unique identifier for this request.
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the speak operation.
- Attributes
Remarks
Speaks the text using the specified queuing strategy and speech parameters, the text may be spanned with TtsSpans. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
) and using the Engine#KEY_PARAM_UTTERANCE_ID
parameter.
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
Speak(String, QueueMode, Bundle, String)
Speaks the text using the specified queuing strategy and speech parameters, the text may be spanned with TtsSpans.
public Android.Speech.Tts.OperationResult Speak (string? text, Android.Speech.Tts.QueueMode queueMode, Android.OS.Bundle? params, string? utteranceId);
member this.Speak : string * Android.Speech.Tts.QueueMode * Android.OS.Bundle * string -> Android.Speech.Tts.OperationResult
Parameters
- text
- String
The string of text to be spoken. No longer than
#getMaxSpeechInputLength()
characters.
- queueMode
- QueueMode
The queuing strategy to use, #QUEUE_ADD
or #QUEUE_FLUSH
.
- params
- Bundle
Parameters for the request. Can be null.
Supported parameter names:
Engine#KEY_PARAM_STREAM
,
Engine#KEY_PARAM_VOLUME
,
Engine#KEY_PARAM_PAN
.
Engine specific parameters may be passed in but the parameter keys
must be prefixed by the name of the engine they are intended for. For example
the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the
engine named "com.svox.pico" if it is being used.
- utteranceId
- String
An unique identifier for this request.
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the speak operation.
Remarks
Speaks the text using the specified queuing strategy and speech parameters, the text may be spanned with TtsSpans. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
) and using the Engine#KEY_PARAM_UTTERANCE_ID
parameter.
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.