Functions
The following functions are available globally.
-
Returns the size in bytes of
property
fromobjectID
Throws
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 -> Int
Parameters
property
The address of the desired property
objectID
The audio object to query
qualifier
An optional property qualifier
-
Reads
size
bytes ofproperty
fromobjectID
intoptr
Throws
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) throws
Parameters
property
The address of the desired property
objectID
The audio object to query
ptr
A pointer to receive the property’s value
size
The number of bytes to read
qualifier
An optional property qualifier
-
Writes
size
bytes fromptr
toproperty
onobjectID
Throws
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) throws
Parameters
property
The address of the desired property
objectID
The audio object to change
ptr
A pointer to the desired property value
size
The number of bytes to write
qualifier
An optional property qualifier
-
Returns the numeric value of
property
Note
The underlying audio object property must be backed by an equivalent native C type ofT
Throws
An error ifobjectID
does not haveproperty
or 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 : Numeric
Parameters
property
The address of the desired property
objectID
The audio object to query
type
The underlying numeric type
qualifier
An optional property qualifier
initialValue
An optional initial value for
outData
when callingAudioObjectGetPropertyData
-
Returns the Core Foundation object value of
property
Note
The underlying audio object property must be backed by a Core Foundation object and return aCFType
with a +1 retain countThrows
An error ifobjectID
does not haveproperty
or 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 : AnyObject
Parameters
property
The address of the desired property
objectID
The audio object to query
type
The underlying
CFType
qualifier
An optional property qualifier
-
Returns the array value of
property
Note
The underlying audio object property must be backed by a C array ofT
Throws
An error ifobjectID
does not haveproperty
or 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
property
The address of the desired property
objectID
The audio object to query
type
The underlying array element type
qualifier
An optional property qualifier