---
title: "speechSynthesizer(_:didCancel:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:didcancel:)"
---

# speechSynthesizer(_:didCancel:)

Tells the delegate when the synthesizer cancels speaking an utterance.

## Declaration

```swift
optional func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didCancel utterance: AVSpeechUtterance)
```

## Parameters

- `synthesizer`: The speech synthesizer that cancels speaking the utterance.
- `utterance`: The utterance that the speech synthesizer cancels speaking.

## Discussion

Discussion The system only calls this method if a speech synthesizer is speaking an utterance and the system calls its stopSpeaking(at:) method. The system doesn’t call this method if the synthesizer is in a delay between utterances when speech stops, and it doesn’t call it for unspoken utterances.

## See Also

### Responding to speech synthesis events

- [speechSynthesizer(_:didStart:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:didstart:).md)
- [speechSynthesizer(_:willSpeakRangeOfSpeechString:utterance:)](avfaudio/avspeechsynthesizerdelegate/speechsynthesizer(_:willspeakrangeofspeechstring:utterance:).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)
