Partager via


UtteranceProgressListener.OnBeginSynthesis Method

Definition

Called when the TTS engine begins to synthesize the audio for a request.

[Android.Runtime.Register("onBeginSynthesis", "(Ljava/lang/String;III)V", "GetOnBeginSynthesis_Ljava_lang_String_IIIHandler", ApiSince=24)]
public virtual void OnBeginSynthesis (string? utteranceId, int sampleRateInHz, Android.Media.Encoding audioFormat, int channelCount);
[<Android.Runtime.Register("onBeginSynthesis", "(Ljava/lang/String;III)V", "GetOnBeginSynthesis_Ljava_lang_String_IIIHandler", ApiSince=24)>]
abstract member OnBeginSynthesis : string * int * Android.Media.Encoding * int -> unit
override this.OnBeginSynthesis : string * int * Android.Media.Encoding * int -> unit

Parameters

utteranceId
String

The utterance ID of the utterance.

sampleRateInHz
Int32

Sample rate in hertz of the generated audio.

audioFormat
Encoding

Audio format of the generated audio. Should be one of AudioFormat#ENCODING_PCM_8BIT, AudioFormat#ENCODING_PCM_16BIT or AudioFormat#ENCODING_PCM_FLOAT.

channelCount
Int32

The number of channels.

Attributes

Remarks

Called when the TTS engine begins to synthesize the audio for a request.

It provides information about the format of the byte array for subsequent #onAudioAvailable calls.

This is called when the TTS engine starts synthesizing audio for the request. If an application wishes to know when the audio is about to start playing, {#onStart(String)} should be used instead.

Java documentation for android.speech.tts.UtteranceProgressListener.onBeginSynthesis(java.lang.String, int, int, int).

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