<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVSpeechUtterance/init(ssmlRepresentation:)-8zam9",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVSpeechUtterance(im)initWithSSMLRepresentation:"
  },
  "title" : "init(ssmlRepresentation:)"
}
-->

# init(ssmlRepresentation:)

Creates a speech utterance with an Speech Synthesis Markup Language (SSML) string.

```
init?(ssmlRepresentation string: String)
```

## Parameters

`string`

A string to speak that contains valid SSML markup. The initializer returns `nil` if you pass an invalid SSML string.

## Discussion

If using SSML to request voices that fall under certain attributes, the system may split a single utterance into multiple parts and send each to an appropriate synthesizer.

If no voice matches the properties, the utterance uses the voice set in its [`voice`](/documentation/AVFAudio/AVSpeechUtterance/voice) property. If you don’t specify a voice, the system uses its default voice.

> Note:
> Speech utterance properties that affect the prosody of a voice, such as its ``doc://com.apple.avfaudio/documentation/AVFAudio/AVSpeechUtterance/rate`` and ``doc://com.apple.avfaudio/documentation/AVFAudio/AVSpeechUtterance/pitchMultiplier``, don’t apply to an utterance that uses an SSML representation.

---

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)