Contents

SpeechErrorProcPtr

Defines a pointer to an error callback functionthat handles syntax errors within commands embedded in a text bufferbeing processed by the Speech Synthesis Manager.

Declaration

typealias SpeechErrorProcPtr = (SpeechChannel, SRefCon, OSErr, Int) -> Void

Parameters

  • chan:

    The speech channel that has finished processing input text.

  • refCon:

    The reference constant associated with the speech channel.

  • theError:

    The error that occurred in processing an embedded command.

  • bytePos:

    The number of bytes from the beginning of the text buffer being spoken to the error encountered.

Discussion

The Speech Synthesis Manager calls a speech channel’s errorcallback function whenever it encounters a syntax error within acommand embedded in a text buffer it is processing. This can beuseful during application debugging, to detect problems with commandsthat you have embedded in text buffers that your application speaks.It can also be useful if your application allows users to embedcommands within text buffers. Your application might display analert indicating that the Speech Synthesis Manager encountered a problemin processing an embedded command.

Ordinarily, the error information that the Speech SynthesisManager provides the error callback function should be sufficient.However, if your application needs information about errors thatoccurred before the error callback function was enabled, the application (includingthe error callback function) can call the GetSpeechInfo functionwith the soErrors selector.

You can specify an error callback function by passing the soErrorCallBack selectorto the SetSpeechInfo function.

See Also

Callbacks