Type Alias

SpeechWordProcPtr

Defines a pointer to a word callback function that is called by the Speech Synthesis Manager before it pronounces a word.

Declaration

typedef void (*SpeechWordProcPtr)(SpeechChannel chan, SRefCon refCon, unsigned long wordPos, UInt16 wordLen);

Parameters

chan

The speech channel that has finished processing input text.

refCon

The reference constant associated with the speech channel.

wordPos

The number of bytes between the beginning of the text buffer and the beginning of the word about to be pronounced.

wordLen

The length in bytes of the word about to be pronounced.

Discussion

The Speech Synthesis Manager calls a speech channel’s word callback function just before it pronounces a word. You might use such a callback function, for example, to draw the word about to be spoken in a window. In this case, the callback function would set a global flag variable to indicate that the word being spoken is changing and another two global variables to wordPos and wordLen. A function called by your application’s main event loop could detect that the word being spoken is changing and draw the word in a window.

You can specify a word callback function by passing the soWordCallBack selector to the SetSpeechInfo function.

See Also

Callbacks

SpeechDoneProcPtr

Defines a pointer to a speech-done callback function which is called when the Speech Synthesis Manager finishes speaking a buffer of text.

SpeechErrorProcPtr

Defines a pointer to an error callback function that handles syntax errors within commands embedded in a text buffer being processed by the Speech Synthesis Manager.

SpeechErrorCFProcPtr

Defines a pointer to an error callback function that handles syntax errors within commands embedded in a CFString object being processed by the Speech Synthesis Manager.

SpeechPhonemeProcPtr

Defines a pointer to a phoneme callback function that is called by the Speech Synthesis Manager before it pronounces a phoneme.

SpeechSyncProcPtr

Defines a pointer to a synchronization callback function that is called when the Speech Synthesis Manager encounters a synchronization command embedded in a text buffer.

SpeechTextDoneProcPtr

Defines a pointer to a text-done callback function that is called when the Speech Synthesis Manager has finished processing a buffer of text.

SpeechWordCFProcPtr

Defines a pointer to a Core Foundation-based word callback function that is called by the Speech Synthesis Manager before it pronounces a word.