---
title: Speech synthesis
framework: AVFAudio
role: collectionGroup
role_heading: API Collection
path: avfaudio/speech-synthesis
---

# Speech synthesis

Configure voices to speak strings of text.

## Overview

Overview Speech synthesis in AVFAudio requires two primary tasks: Create an AVSpeechUtterance instance that contains the text to speak. Optionally, configure speech parameters, such as voice and rate, for each utterance. // 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 AVSpeechSynthesizer instance to produce spoken audio. // 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 delegate to receive speech event notifications.

## Topics

### Spoken text attributes

- [AVSpeechUtterance](avfaudio/avspeechutterance.md)
- [AVSpeechSynthesisVoice](avfaudio/avspeechsynthesisvoice.md)

### Speech synthesis controls

- [AVSpeechSynthesizer](avfaudio/avspeechsynthesizer.md)

### Speech synthesis Audio Unit

- [Creating a custom speech synthesizer](avfaudio/creating-a-custom-speech-synthesizer.md)
- [AVSpeechSynthesisProviderAudioUnit](avfaudio/avspeechsynthesisprovideraudiounit.md)
