Instance Method

speechSynthesizer:didEncounterErrorAtIndex:ofString:message:

Sent to the delegate when a speech synthesizer encounters an error in text being synthesized.

Declaration

- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didEncounterErrorAtIndex:(NSUInteger)characterIndex ofString:(NSString *)string message:(NSString *)message;

Parameters

sender

Speech synthesizer informing its delegate of an error.

characterIndex

Location in text where the receiver encountered the error.

text

Text the receiver was synthesizing when the error occurred.

errorMessage

Error message.

Discussion

The synthesizer sends an error delegate message whenever it encounters a syntax error within a command embedded in the string it is processing. This can be useful during application debugging, to detect problems with commands that you have embedded in strings that your application speaks. It can also be useful if your application allows users to embed commands within strings. Your application might display an alert indicating that the synthesizer encountered a problem in processing an embedded command.

If your application needs information about errors that occurred prior to calling your error delegate method, the application (including the error delegate method) can call the sender’s objectForProperty:error: method with the NSSpeechErrorsProperty constant.

See Also

Synthesizing Speech

- speechSynthesizer:willSpeakWord:ofString:

Sent just before a synthesized word is spoken through the sound output device.

- speechSynthesizer:willSpeakPhoneme:

Sent just before a synthesized phoneme is spoken through the sound output device.

- speechSynthesizer:didEncounterSyncMessage:

Sent to the delegate when a speech synthesizer encounters a synchronization error.

- speechSynthesizer:didFinishSpeaking:

Sent when an NSSpeechSynthesizer object finishes speaking through the sound output device.