FileDocCategorySizeDatePackage
AbstractSynthesisCallback.javaAPI DocAndroid 5.1 API2070Thu Mar 12 22:22:10 GMT 2015android.speech.tts

AbstractSynthesisCallback

public abstract class AbstractSynthesisCallback extends Object implements SynthesisCallback
Defines additional methods the synthesis callback must implement that are private to the TTS service implementation. All of these class methods (with the exception of {@link #stop()}) can be only called on the synthesis thread, while inside {@link TextToSpeechService#onSynthesizeText} or {@link TextToSpeechService#onSynthesizeTextV2}. {@link #stop()} is the exception, it may be called from multiple threads.

Fields Summary
protected final boolean
mClientIsUsingV2
If true, request comes from V2 TTS interface
Constructors Summary
AbstractSynthesisCallback(boolean clientIsUsingV2)
Constructor.

param
clientIsUsingV2 If true, this callback will be used inside {@link TextToSpeechService#onSynthesizeTextV2} method.

        mClientIsUsingV2 = clientIsUsingV2;
    
Methods Summary
interrorCodeOnStop()
Get status code for a "stop". V2 Clients will receive special status, V1 clients will receive standard error. This method should only be called on the synthesis thread, while in {@link TextToSpeechService#onSynthesizeText}.

        return mClientIsUsingV2 ? TextToSpeech.STOPPED : TextToSpeech.ERROR;
    
abstract voidstop()
Aborts the speech request. Can be called from multiple threads.