<!--
{
  "documentType" : "article",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/speech-synthesis",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Speech synthesis"
}
-->

# Speech synthesis

Configure voices to speak strings of text.

## Discussion

The Speech Synthesis framework manages voice and speech synthesis, and requires two primary tasks:

Create an <doc://com.apple.documentation/documentation/AVFAudio/AVSpeechUtterance> instance that contains the text to speak. Optionally, configure speech parameters, such as voice and rate, for each utterance.

```swift
// Create an utterance.
let utterance = AVSpeechUtterance(string: "The quick brown fox jumped over the lazy dog.")

// Configure the utterance.
utterance.rate = 0.57
utterance.pitchMultiplier = 0.8
utterance.postUtteranceDelay = 0.2
utterance.volume = 0.8

// Retrieve the British English voice.
let voice = AVSpeechSynthesisVoice(language: "en-GB")

// Assign the voice to the utterance.
utterance.voice = voice
```

Pass the utterance to an <doc://com.apple.documentation/documentation/AVFAudio/AVSpeechSynthesizer> instance to produce spoken audio.

```swift
// Create a speech synthesizer.
let synthesizer = AVSpeechSynthesizer()

// Tell the synthesizer to speak the utterance.
synthesizer.speak(utterance)
```

Optionally, use the speech synthesizer instance to control or respond to ongoing speech; for example, assign its <doc://com.apple.documentation/documentation/AVFAudio/AVSpeechSynthesizer/delegate> to receive speech event notifications.

> Note:
> Speech generation occurs on device and isn’t sent to a server for processing.

## Topics

### Spoken text attributes

  <doc://com.apple.documentation/documentation/AVFAudio/AVSpeechUtterance>

  <doc://com.apple.documentation/documentation/AVFAudio/AVSpeechSynthesisVoice>

### Speech synthesis controls

  <doc://com.apple.documentation/documentation/AVFAudio/AVSpeechSynthesizer>

### Speech synthesis audio unit

  <doc://com.apple.documentation/documentation/AVFAudio/AVSpeechSynthesisProviderAudioUnit>



---

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)