speechSynthesizer(_:willSpeakRangeOfSpeechString:utterance:)
Tells the delegate when the synthesizer is about to speak a portion of an utterance’s text.
Declaration
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 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
The system calls this method once for each unit of speech in the utterance’s text, which is generally a word.