Interface VocalizerListener

ru.yandex.speechkit

public  interface  VocalizerListener 

The interface defines callback methods for tracking speech synthesis and playback events.

The methods are called by an object of the Vocalizer class when its status changes: receipt of speech synthesis results, the end of speech synthesis, the occurrence of errors.

If synthesized speech is played through the embedded SpeechKit player, the methods are called when starting, pausing, and ending playback.

Methods

voidonPartialSynthesis(@NonNull final Vocalizer vocalizer, @NonNull final Synthesis synthesis)

Called when the server finished the synthesis of a part of speech and it can be played back.

voidonPlayingBegin(@NonNull final Vocalizer vocalizer)

Called when the embedded SpeechKit player starts producing audio.

voidonPlayingDone(@NonNull final Vocalizer vocalizer)

Called when the embedded SpeechKit player finishes producing audio.

voidonSynthesisDone(@NonNull final Vocalizer vocalizer)

Called when the server finished speech synthesis.

voidonVocalizerError(@NonNull final Vocalizer vocalizer, @NonNull final Error error)

Called if errors occurred during speech synthesis or playback.

Method Detail

onPartialSynthesis

public void onPartialSynthesis (@NonNull final Vocalizer vocalizer, @NonNull final Synthesis synthesis)

Called when the server finished the synthesis of a part of speech and it can be played back.

If isAutoPlay() is set to true, playback begins automatically using built-in SpeechKit resources. This method is called each time a new audio fragment is received.
Parameters:
vocalizer

Link to the object of the Vocalizer class that invoked the method.

synthesis

An object of the Synthesis class that contains the results of speech synthesis.

onPlayingBegin

public void onPlayingBegin (@NonNull final Vocalizer vocalizer)

Called when the embedded SpeechKit player starts producing audio.

Parameters:
vocalizer

Link to the object of the Vocalizer class that invoked the method.

onPlayingDone

public void onPlayingDone (@NonNull final Vocalizer vocalizer)

Called when the embedded SpeechKit player finishes producing audio.

Parameters:
vocalizer

Link to the object of the Vocalizer class that invoked the method.

onSynthesisDone

public void onSynthesisDone (@NonNull final Vocalizer vocalizer)

Called when the server finished speech synthesis.

Parameters:
vocalizer

Link to the object of the OnlineVocalizer class that invoked the method.

onVocalizerError

public void onVocalizerError (@NonNull final Vocalizer vocalizer, @NonNull final Error error)

Called if errors occurred during speech synthesis or playback.

Parameters:
vocalizer

Link to the object of the Vocalizer class that invoked the method.

error

An error that occurred during speech synthesis or playback (Error).