Instance Method

speechSynthesizer:willSpeakRangeOfSpeechString:utterance:

Tells the delegate when the synthesizer is about to speak a portion of an utterance’s text.

Declaration

- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer willSpeakRangeOfSpeechString:(NSRange)characterRange utterance:(AVSpeechUtterance *)utterance;

Parameters

synthesizer

The synthesizer speaking the utterance that this message applies to.

characterRange

The range of characters in the utterance’s speechString corresponding to the unit of speech about to be spoken.

utterance

The utterance currently being spoken.

Discussion

Because this delegate message is sent once for each unit of speech (generally, a word) in the utterance’s text, you can use it for such purposes as highlighting each word onscreen as it is spoken.

See Also

Responding to Speech Synthesis Events

- speechSynthesizer:didCancelSpeechUtterance:

Tells the delegate when the synthesizer has canceled speaking an utterance.

- speechSynthesizer:didContinueSpeechUtterance:

Tells the delegate when the synthesizer has resumed speaking an utterance after being paused.

- speechSynthesizer:didFinishSpeechUtterance:

Tells the delegate when the synthesizer has finished speaking an utterance.

- speechSynthesizer:didPauseSpeechUtterance:

Tells the delegate when the synthesizer has paused while speaking an utterance.

- speechSynthesizer:didStartSpeechUtterance:

Tells the delegate when the synthesizer has begun speaking an utterance.