---
title: "speechSynthesizer(_:willSpeakRangeOfSpeechString:utterance:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:willspeakrangeofspeechstring:utterance:)"
---

# speechSynthesizer(_:willSpeakRangeOfSpeechString:utterance:)

Tells the delegate when the synthesizer is about to speak a portion of an utterance’s text.

## Declaration

```swift
optional func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, willSpeakRangeOfSpeechString characterRange: NSRange, utterance: AVSpeechUtterance)
```

## Parameters

- `synthesizer`: The speech synthesizer that’s about to speak an utterance.
- `characterRange`: The range of characters in the utterance’s doc://com.apple.avfaudio/documentation/AVFAudio/AVSpeechUtterance/speechString that correspond to the unit of speech the synthesizer is about to speak.
- `utterance`: The utterance that the speech synthesizer is about to speak.

## Discussion

Discussion The system calls this method once for each unit of speech in the utterance’s text, which is generally a word. tip: Implement this method if you want to provide a user interface to visually highlight each word as the synthesizer speaks it.

## See Also

### Responding to speech synthesis events

- [speechSynthesizer(_:didStart:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:didstart:).md)
- [speechSynthesizer(_:willSpeak:utterance:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:willspeak:utterance:).md)
- [speechSynthesizer(_:didPause:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:didpause:).md)
- [speechSynthesizer(_:didContinue:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:didcontinue:).md)
- [speechSynthesizer(_:didFinish:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:didfinish:).md)
- [speechSynthesizer(_:didCancel:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:didcancel:).md)
