---
title: "init(attributedString:)"
framework: avfaudio
role: symbol
role_heading: Initializer
path: "avfaudio/avspeechutterance/init(attributedstring:)"
---

# init(attributedString:)

Creates an utterance with the attributed text string that you specify for the speech synthesizer to speak.

## Declaration

```swift
init(attributedString string: NSAttributedString)
```

## Parameters

- `string`: A string that contains the text to speak.

## Discussion

Discussion To speak the text, pass the utterance to an instance of AVSpeechSynthesizer.

## See Also

### Creating an utterance

- [init(string:)](avfaudio/avspeechutterance/init(string:).md)
- [AVSpeechSynthesisIPANotationAttribute](avfaudio/avspeechsynthesisipanotationattribute.md)
- [init(ssmlRepresentation:)](avfaudio/avspeechutterance/init(ssmlrepresentation:)-8zam9.md)
