---
title: "object(forProperty:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsspeechsynthesizer/object(forproperty:)"
---

# object(forProperty:)

Provides the value of a receiver’s property.

## Declaration

```swift
func object(forProperty property: NSSpeechSynthesizer.SpeechPropertyKey) throws -> Any
```

## Parameters

- `property`: Property to get.

## Return Value

Return Value The value of speechProperty.

## Discussion

Discussion note: In Swift, this method returns a nonoptional result and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Configuring Speech Attributes

- [addSpeechDictionary(_:)](appkit/nsspeechsynthesizer/addspeechdictionary(_:).md)
- [NSSpeechSynthesizer.DictionaryKey](appkit/nsspeechsynthesizer/dictionarykey.md)
- [setObject(_:forProperty:)](appkit/nsspeechsynthesizer/setobject(_:forproperty:).md)
- [NSSpeechSynthesizer.SpeechPropertyKey](appkit/nsspeechsynthesizer/speechpropertykey.md)
- [NSSpeechSynthesizer.SpeechPropertyKey.CommandDelimiterKey](appkit/nsspeechsynthesizer/speechpropertykey/commanddelimiterkey.md)
- [NSSpeechSynthesizer.SpeechPropertyKey.ErrorKey](appkit/nsspeechsynthesizer/speechpropertykey/errorkey.md)
- [NSSpeechSynthesizer.SpeechPropertyKey.Mode](appkit/nsspeechsynthesizer/speechpropertykey/mode.md)
- [NSSpeechSynthesizer.SpeechPropertyKey.PhonemeInfoKey](appkit/nsspeechsynthesizer/speechpropertykey/phonemeinfokey.md)
- [NSSpeechSynthesizer.SpeechPropertyKey.StatusKey](appkit/nsspeechsynthesizer/speechpropertykey/statuskey.md)
- [NSSpeechSynthesizer.SpeechPropertyKey.SynthesizerInfoKey](appkit/nsspeechsynthesizer/speechpropertykey/synthesizerinfokey.md)
- [NSSpeechSynthesizer.VoiceGender](appkit/nsspeechsynthesizer/voicegender.md)
