![]() |
SpeechWordProcPtr |
||||
Header: | SpeechSynthesis.h | Carbon status: | Supported | |
Defines a pointer to a word callback function. Your word function is called by the Speech Manager before it pronounces a word.
typedef void(* SpeechWordProcPtr) ( SpeechChannel chan, SInt32 refCon, UInt32 wordPos, UInt16 wordLen );
You would declare your function like this if you were to name it MySpeechWordCallback:
void MySpeechWordCallback ( SpeechChannel chan, SInt32 refCon, UInt32 wordPos, UInt16 wordLen );
The speech channel that has finished processing input text.
The reference constant associated with the speech channel.
The number of bytes between the beginning of the text buffer and the beginning of the word about to be pronounced.
The length in bytes of the word about to be pronounced.
The Speech Manager calls a speech channels 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 applications 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 procedure by passing the soWordCallBack selector to the SetSpeechInfo function.
Because your callback function executes at interrupt time, you must not call any functions that might move or purge memory.
Your callback function is able to access application global variables only if the A5 register is properly set. The Speech Manager sets A5 to the proper value if you provide your applications A5 value by calling the SetSpeechInfo function with the soCurrentA5 selector.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)