Udostępnij za pośrednictwem


UtteranceProgressListener.OnRangeStart(String, Int32, Int32, Int32) Method

Definition

This is called when the TTS service is about to speak the specified range of the utterance with the given utteranceId.

[Android.Runtime.Register("onRangeStart", "(Ljava/lang/String;III)V", "GetOnRangeStart_Ljava_lang_String_IIIHandler", ApiSince=26)]
public virtual void OnRangeStart (string? utteranceId, int start, int end, int frame);
[<Android.Runtime.Register("onRangeStart", "(Ljava/lang/String;III)V", "GetOnRangeStart_Ljava_lang_String_IIIHandler", ApiSince=26)>]
abstract member OnRangeStart : string * int * int * int -> unit
override this.OnRangeStart : string * int * int * int -> unit

Parameters

utteranceId
String

Unique id identifying the synthesis request.

start
Int32

The start index of the range in the utterance text.

end
Int32

The end index of the range (exclusive) in the utterance text.

frame
Int32

The position in frames in the audio of the request where this range is spoken.

Attributes

Remarks

This is called when the TTS service is about to speak the specified range of the utterance with the given utteranceId.

This method is called when the audio is expected to start playing on the speaker. Note that this is different from #onAudioAvailable which is called as soon as the audio is generated.

This information can be used, for example, to highlight ranges of the text while it is spoken.

Only called if the engine supplies timing information by calling SynthesisCallback#rangeStart(int, int, int).

Java documentation for android.speech.tts.UtteranceProgressListener.onRangeStart(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