---
title: "setVoice(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsspeechsynthesizer/setvoice(_:)"
---

# setVoice(_:)

Sets the receiver’s current voice.

## Declaration

```swift
func setVoice(_ voice: NSSpeechSynthesizer.VoiceName?) -> Bool
```

## Parameters

- `voice`: Identifier of the voice to set at the receiver’s current voice. When nil, the receiver sets the default voice as its current voice.

## Return Value

Return Value true when the receiver is not currently synthesizing speech and the current voice is set successfully, false otherwise.

## See Also

### Related Documentation

- [defaultVoice](appkit/nsspeechsynthesizer/defaultvoice.md)

### Configuring Speech Synthesizers

- [usesFeedbackWindow](appkit/nsspeechsynthesizer/usesfeedbackwindow.md)
- [voice()](appkit/nsspeechsynthesizer/voice().md)
- [rate](appkit/nsspeechsynthesizer/rate.md)
- [volume](appkit/nsspeechsynthesizer/volume.md)
