Contents

SpeechPhonemeProcPtr

Defines a pointer to a phoneme callback functionthat is called by the Speech Synthesis Manager before it pronouncesa phoneme.

Declaration

typealias SpeechPhonemeProcPtr = (SpeechChannel, SRefCon, Int16) -> Void

Parameters

  • 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.

Discussion

The Speech Synthesis Manager calls a speech channel’s phonemecallback function just before it pronounces a phoneme. For example,your application might use such a callback function to enable mouthsynchronization. In this case, the callback function would set a globalflag variable to indicate that the phoneme being pronounced is changingand another global variable to phonemeOpcode.A function called by your application’s main event loop coulddetect that the phoneme being pronounced is changing and updatea picture of a mouth to reflect the current phoneme. In practice,providing a visual indication of the pronunciation of a phonemerequires several consecutive pictures of mouth movement to be rapidlydisplayed. Consult the linguistics literature for information on mouthmovements associated with different phonemes.

You can specify a phoneme callback function by passing the soPhonemeCallBack selectorto the SetSpeechInfo function.

See Also

Callbacks