speechSynthesizer(_:willSpeakPhoneme:)
Sent just before a synthesized phoneme is spoken through the sound output device.
Declaration
@MainActor optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, willSpeakPhoneme phonemeOpcode: Int16)Parameters
- sender:
An Nsspeechsynthesizer object that’s synthesizing text into speech.
- phonemeOpcode:
Phoneme that
senderis about to speak into the sound output device.
Discussion
One use of this method might be to animate a mouth on screen to match the generated speech.
Special Considerations
This method is not sent for modern voices. It is only supported for MacinTalk voices.
In OS X v10.4 and earlier, the delegate is not sent this message when the NSSpeechSynthesizer object is synthesizing speech to a file (startSpeaking(_:to:)).