Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 4 - Speech Manager / Speech Manager Reference
Application-Defined Routines / Phoneme Callback Procedure


Legacy Documentclose button

Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.

MyPhonemeCallback

A phoneme callback procedure has the following syntax:

PROCEDURE MyPhonemeCallback (chan: SpeechChannel; refCon: LongInt;
                              phonemeOpcode: Integer);
chan
The speech channel that has finished processing input text.
refCon
The reference constant associated with the speech channel.
phonemeOpcode
The phoneme about to be pronounced.
DESCRIPTION
The Speech Manager calls a speech channel's phoneme callback procedure just before it pronounces a phoneme. For example, your application might use such a callback procedure to enable mouth synchronization. In this case, the callback procedure would set a global flag variable to indicate that the phoneme being pronounced is changing and another global variable to phonemeOpcode. A routine called by your application's 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.

SPECIAL CONSIDERATIONS
Because your callback procedure executes at interrupt time, you must not call any routines that might move or purge memory.

Your callback procedure 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 application's A5 value by calling the SetSpeechInfo function with the soCurrentA5 selector.

ASSEMBLY-LANGUAGE INFORMATION
Because a callback procedure is called at interrupt time, it must preserve all registers other than A0-A2 and D0-D2.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996