Functions
The following functions are available globally.
-
Returns the size in bytes of
propertyfromobjectIDThrows
An exception if the object does not have the requested property or the property value could not be retrievedDeclaration
Swift
public func audioObjectPropertySize(_ property: PropertyAddress, from objectID: AudioObjectID, qualifier: PropertyQualifier? = nil) throws -> IntParameters
propertyThe address of the desired property
objectIDThe audio object to query
qualifierAn optional property qualifier
-
Reads
sizebytes ofpropertyfromobjectIDintoptrThrows
An exception if the object does not have the requested property or the property value could not be retrievedDeclaration
Swift
public func readAudioObjectProperty<T>(_ property: PropertyAddress, from objectID: AudioObjectID, into ptr: UnsafeMutablePointer<T>, size: Int = MemoryLayout<T>.stride, qualifier: PropertyQualifier? = nil) throwsParameters
propertyThe address of the desired property
objectIDThe audio object to query
ptrA pointer to receive the property’s value
sizeThe number of bytes to read
qualifierAn optional property qualifier
-
Writes
sizebytes fromptrtopropertyonobjectIDThrows
An exception if the object does not have the requested property, the property is not settable, or the property value could not be setDeclaration
Swift
public func writeAudioObjectProperty<T>(_ property: PropertyAddress, on objectID: AudioObjectID, from ptr: UnsafePointer<T>, size: Int = MemoryLayout<T>.stride, qualifier: PropertyQualifier? = nil) throwsParameters
propertyThe address of the desired property
objectIDThe audio object to change
ptrA pointer to the desired property value
sizeThe number of bytes to write
qualifierAn optional property qualifier
-
Returns the numeric value of
propertyNote
The underlying audio object property must be backed by an equivalent native C type ofTThrows
An error ifobjectIDdoes not havepropertyor the property value could not be retrievedDeclaration
Swift
public func getAudioObjectProperty<T>(_ property: PropertyAddress, from objectID: AudioObjectID, type: T.Type, qualifier: PropertyQualifier? = nil, initialValue: T = 0) throws -> T where T : NumericParameters
propertyThe address of the desired property
objectIDThe audio object to query
typeThe underlying numeric type
qualifierAn optional property qualifier
initialValueAn optional initial value for
outDatawhen callingAudioObjectGetPropertyData -
Returns the Core Foundation object value of
propertyNote
The underlying audio object property must be backed by a Core Foundation object and return aCFTypewith a +1 retain countThrows
An error ifobjectIDdoes not havepropertyor the property value could not be retrievedDeclaration
Swift
public func getAudioObjectProperty<T>(_ property: PropertyAddress, from objectID: AudioObjectID, type: T.Type, qualifier: PropertyQualifier? = nil) throws -> T where T : AnyObjectParameters
propertyThe address of the desired property
objectIDThe audio object to query
typeThe underlying
CFTypequalifierAn optional property qualifier
-
Returns the array value of
propertyNote
The underlying audio object property must be backed by a C array ofTThrows
An error ifobjectIDdoes not havepropertyor the property value could not be retrievedDeclaration
Swift
public func getAudioObjectProperty<T>(_ property: PropertyAddress, from objectID: AudioObjectID, elementType type: T.Type, qualifier: PropertyQualifier? = nil) throws -> [T]Parameters
propertyThe address of the desired property
objectIDThe audio object to query
typeThe underlying array element type
qualifierAn optional property qualifier
View on GitHub
Functions Reference