---
title: "speechSynthesizer(_:willSpeakWord:of:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsspeechsynthesizerdelegate/speechsynthesizer(_:willspeakword:of:)"
---

# speechSynthesizer(_:willSpeakWord:of:)

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

## Declaration

```swift
@MainActor optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, willSpeakWord characterRange: NSRange, of string: String)
```

## Parameters

- `sender`: An doc://com.apple.appkit/documentation/AppKit/NSSpeechSynthesizer object that’s synthesizing text into speech.
- `characterRange`: Word that sender is about to speak into the sound output device.
- `string`: Text that is being synthesized by sender.

## Discussion

Discussion One use of this method might be to visually highlight the word being spoken. important: 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)
- [Speech Programming Topics](apple-archive/documentation/Cocoa/Conceptual/Speech.md)

### Synthesizing Speech

- [speechSynthesizer(_:willSpeakPhoneme:)](appkit/nsspeechsynthesizerdelegate/speechsynthesizer(_:willspeakphoneme:).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)
