![]() |
SpeechPhonemeProcPtr |
||||
Header: | SpeechSynthesis.h | Carbon status: | Supported | |
Defines a phoneme callback function. Your phoneme function is called by the Speech manager before it pronounces a phoneme.
typedef void(* SpeechPhonemeProcPtr) ( SpeechChannel chan, SInt32 refCon, SInt16 phonemeOpcode );
You would declare your function like this if you were to name it MySpeechPhonemeCallback:
void MySpeechPhonemeCallback ( SpeechChannel chan, SInt32 refCon, SInt16 phonemeOpcode );
The speech channel that has finished processing input text.
The reference constant associated with the speech channel.
The phoneme about to be pronounced.
The Speech Manager calls a speech channels phoneme callback function just before it pronounces a phoneme. For example, your application might use such a callback function to enable mouth synchronization. In this case, the callback function would set a global flag variable to indicate that the phoneme being pronounced is changing and another global variable to phonemeOpcode. A function called by your applications main event loop could detect that the phoneme being pronounced is changing and update a picture of a mouth to reflect the current phoneme. In practice, providing a visual indication of the pronunciation of a phoneme requires several consecutive pictures of mouth movement to be rapidly displayed. Consult the linguistics literature for information on mouth movements associated with different phonemes.
You can specify a phoneme callback procedure by passing the soPhonemeCallBack 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)