VocalizerListener interface

ru.yandex.speechkit

public  interface  VocalizerListener 

The interface defines callback methods for tracking speech synthesis events.

Methods will be called by an object of the Vocalizer class when its state changes: the starting, pausing, or completion of speech synthesis, or an error occurs.

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

Methods

voidonPlayingBegin(Vocalizer vocalizer)

Called when the embedded SpeechKit player starts producing audio.

voidonPlayingDone(Vocalizer vocalizer)

Called when the embedded SpeechKit player finishes producing audio.

voidonSynthesisBegin(Vocalizer vocalizer)

Called when speech synthesis is launched.

voidonSynthesisDone(Vocalizer vocalizer, Synthesis synthesis)

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

voidonVocalizerError(Vocalizer vocalizer, Error error)

Called when an error occurs.

Method descriptions

onPlayingBegin

public void onPlayingBegin (Vocalizer vocalizer)

Called when the embedded SpeechKit player starts producing audio.

onPlayingDone

public void onPlayingDone (Vocalizer vocalizer)

Called when the embedded SpeechKit player finishes producing audio.

onSynthesisBegin

public void onSynthesisBegin (Vocalizer vocalizer)

Called when speech synthesis is launched.

onSynthesisDone

public void onSynthesisDone (Vocalizer vocalizer, Synthesis synthesis)

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

If the autoPlay value is true, playback begins automatically using built-in SpeechKit resources. For streamed speech synthesis, the method is called each time an audio fragment is received.

Parameters:
vocalizer

A reference to the Vocalizer object that invoked the method.

synthesis

Object of the Synthesis class containing speech synthesis results.

onVocalizerError

public void onVocalizerError (Vocalizer vocalizer, Error error)

Called when an error occurs.

Parameters:
error

Error (see the description of the Error class).