---
title: "speechSynthesizer(_:willSpeakPhoneme:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsspeechsynthesizerdelegate/speechsynthesizer(_:willspeakphoneme:)"
---

# speechSynthesizer(_:willSpeakPhoneme:)

Sent just before a synthesized phoneme is spoken through the sound output device.

## Declaration

```swift
@MainActor optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, willSpeakPhoneme phonemeOpcode: Int16)
```

## Parameters

- `sender`: An doc://com.apple.appkit/documentation/AppKit/NSSpeechSynthesizer object that’s synthesizing text into speech.
- `phonemeOpcode`: Phoneme that sender is about to speak into the sound output device.

## Discussion

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:)).

## See Also

### Related Documentation

- [startSpeaking(_:)](appkit/nsspeechsynthesizer/startspeaking(_:).md)

### Synthesizing Speech

- [speechSynthesizer(_:willSpeakWord:of:)](appkit/nsspeechsynthesizerdelegate/speechsynthesizer(_:willspeakword:of:).md)
- [speechSynthesizer(_:didEncounterErrorAt:of:message:)](appkit/nsspeechsynthesizerdelegate/speechsynthesizer(_:didencountererrorat:of:message:).md)
- [speechSynthesizer(_:didEncounterSyncMessage:)](appkit/nsspeechsynthesizerdelegate/speechsynthesizer(_:didencountersyncmessage:).md)
- [speechSynthesizer(_:didFinishSpeaking:)](appkit/nsspeechsynthesizerdelegate/speechsynthesizer(_:didfinishspeaking:).md)
