다음을 통해 공유


ISynthesisCallback.Start(Int32, Encoding, Int32) Method

Definition

The service should call this when it starts to synthesize audio for this request.

[Android.Runtime.Register("start", "(III)I", "GetStart_IIIHandler:Android.Speech.Tts.ISynthesisCallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Speech.Tts.OperationResult Start (int sampleRateInHz, Android.Media.Encoding audioFormat, int channelCount);
[<Android.Runtime.Register("start", "(III)I", "GetStart_IIIHandler:Android.Speech.Tts.ISynthesisCallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Start : int * Android.Media.Encoding * int -> Android.Speech.Tts.OperationResult

Parameters

sampleRateInHz
Int32

Sample rate in HZ of the generated audio.

audioFormat
Encoding

Audio format of the generated audio. Must be one of AudioFormat#ENCODING_PCM_8BIT or AudioFormat#ENCODING_PCM_16BIT. Can also be AudioFormat#ENCODING_PCM_FLOAT when targetting Android N and above.

channelCount
Int32

The number of channels. Must be 1 or 2.

Returns

android.speech.tts.TextToSpeech#SUCCESS, android.speech.tts.TextToSpeech#ERROR or android.speech.tts.TextToSpeech#STOPPED.

Attributes

Remarks

The service should call this when it starts to synthesize audio for this request.

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

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