<!--
{
  "availability" : [
    "macOS: 10.3.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSpeechSynthesizerDelegate/speechSynthesizer(_:willSpeakWord:of:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSSpeechSynthesizerDelegate(im)speechSynthesizer:willSpeakWord:ofString:"
  },
  "title" : "speechSynthesizer(_:willSpeakWord:of:)"
}
-->

# speechSynthesizer(_:willSpeakWord:of:)

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

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

## Parameters

`sender`

An [`NSSpeechSynthesizer`](/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

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 (``doc://com.apple.appkit/documentation/AppKit/NSSpeechSynthesizer/startSpeaking(_:to:)``).

## See Also

[`func startSpeaking(String) -> Bool`](/documentation/AppKit/NSSpeechSynthesizer/startSpeaking(_:))

Begins speaking synthesized text through the system’s default sound output device.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)