YSKVocalizerDelegate protocol

#import <YSKVocalizerDelegate.h>

The protocol defines the callback methods of the delegate that tracks speech synthesis events.

Methods are called by an object of the YSKVocalizer 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.

Instance methods

-vocalizer:didFailWithError:

Called when an error occurs.

-vocalizer:didFinishSynthesisWithResult:markerIds:markerMsecs:

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

-vocalizerDidBeginSynthesis:

Called when speech synthesis is launched.

-vocalizerDidFinishPlaying:

Called when the embedded SpeechKit player finishes producing audio.

-vocalizerDidStartPlaying:

Called when the embedded SpeechKit player starts producing audio.

Method descriptions

-vocalizer:didFailWithError:

- (void) vocalizer:(YSKVocalizer *) vocalizer
didFailWithError:(NSError *) error

Called when an error occurs.

Parameters:
error

Error code (see YSKError).

-vocalizer:didFinishSynthesisWithResult:markerIds:markerMsecs:

- (void) vocalizer:(YSKVocalizer *) vocalizer
didFinishSynthesisWithResult:(NSData *) result
markerIds:(NSArray *) markerIds
markerMsecs:(NSArray *) markerMsecs

Called when the server finished speech synthesis and speech 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 a new audio fragment is received.

Parameters:
vocalizer

A reference to an instance of the YSKVocalizer class that called the method.

result

Results of speech synthesis.

-vocalizerDidBeginSynthesis:

- (void) vocalizerDidBeginSynthesis:(YSKVocalizer *) vocalizer

Called when speech synthesis is launched.

-vocalizerDidFinishPlaying:

- (void) vocalizerDidFinishPlaying:(YSKVocalizer *) vocalizer

Called when the embedded SpeechKit player finishes producing audio.

-vocalizerDidStartPlaying:

- (void) vocalizerDidStartPlaying:(YSKVocalizer *) vocalizer

Called when the embedded SpeechKit player starts producing audio.