<!--
{
  "availability" : [
    "macOS: 10.3.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSpeechSynthesizer/init(voice:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSpeechSynthesizer(im)initWithVoice:"
  },
  "title" : "init(voice:)"
}
-->

# init(voice:)

Initializes the receiver with a voice.

```
init?(voice: NSSpeechSynthesizer.VoiceName?)
```

## Parameters

`voice`

Identifier of the voice to set as the current voice. When `nil`, the default voice is used. Passing in a specific voice means the initial speaking rate is determined by the synthesizer’s default speaking rate; passing `nil` means the speaking rate is automatically set to the rate the user specifies in Speech preferences.

## Return Value

Initialized speech synthesizer or `nil` when the voice identified by `voiceIdentifier` is not available or when there’s an allocation error.

## See Also

[`availableVoices`](/documentation/AppKit/NSSpeechSynthesizer/availableVoices)

Provides the identifiers of the voices available on the system.



---

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)