Compartilhar via


ISynthesisCallback.RangeStart(Int32, Int32, Int32) Method

Definition

The service may call this method to provide timing information about the spoken text.

[Android.Runtime.Register("rangeStart", "(III)V", "GetRangeStart_IIIHandler:Android.Speech.Tts.ISynthesisCallback, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual void RangeStart (int markerInFrames, int start, int end);
[<Android.Runtime.Register("rangeStart", "(III)V", "GetRangeStart_IIIHandler:Android.Speech.Tts.ISynthesisCallback, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member RangeStart : int * int * int -> unit
override this.RangeStart : int * int * int -> unit

Parameters

markerInFrames
Int32

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

start
Int32

The start index of the range in the input text.

end
Int32

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

Attributes

Remarks

The service may call this method to provide timing information about the spoken text.

Calling this method means that at the given audio frame, the given range of the input is about to be spoken. If this method is called the client will receive a callback on the listener (UtteranceProgressListener#onRangeStart) at the moment that frame has been reached by the playback head.

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

The markerInFrames is a frame index into the audio for this synthesis request, i.e. into the concatenation of the audio bytes sent to audioAvailable for this synthesis request. The definition of a frame depends on the format given by #start. See AudioFormat for more information.

This method should only be called on the synthesis thread, while in TextToSpeechService#onSynthesizeText.

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