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 tophonemeOpcode
. 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 thesoCurrentA5
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.