AudioSystemObject
public class AudioSystemObject : AudioObject
The HAL audio system object
This class has a single scope (kAudioObjectPropertyScopeGlobal
) and a single element (kAudioObjectPropertyElementMaster
)
Remark
This class correponds to the object with idkAudioObjectSystemObject
and class kAudioSystemObjectClassID
-
The singleton audio system object
Declaration
Swift
public static var instance: AudioSystemObject
-
Returns the
AudioObjectID
for the audio device withuid
ornil
if unknownRemark
This corresponds to the propertykAudioHardwarePropertyTranslateUIDToDevice
Declaration
Swift
public func deviceID(forUID uid: String) throws -> AudioObjectID?
Parameters
uid
The UID of the desired device
-
Returns
true
if audio devices should mix stereo to monoRemark
This corresponds to the propertykAudioHardwarePropertyMixStereoToMono
Declaration
Swift
public func mixStereoToMono() throws -> Bool
-
Sets whether audio devices should mix stereo to mono
Remark
This corresponds to the propertykAudioHardwarePropertyMixStereoToMono
Declaration
Swift
public func setMixStereoToMono(_ value: Bool) throws
-
Returns the
AudioObjectID
for the audio plug-in forbundleID
ornil
if unknownRemark
This corresponds to the propertykAudioHardwarePropertyTranslateBundleIDToPlugIn
Declaration
Swift
public func plugInID(forBundleID bundleID: String) throws -> AudioObjectID?
Parameters
uid
The bundle ID of the desired plug-in
-
Returns the
AudioObjectID
for the audio transport manager forbundleID
ornil
if unknownRemark
This corresponds to the propertykAudioHardwarePropertyTranslateBundleIDToTransportManager
Declaration
Swift
public func transportManagerID(forBundleID bundleID: String) throws -> AudioObjectID?
Parameters
uid
The bundle ID of the desired transport manager
-
Returns the
AudioObjectID
for the audio box withuid
ornil
if unknownRemark
This corresponds to the propertykAudioHardwarePropertyTranslateUIDToBox
Declaration
Swift
public func boxID(forUID uid: String) throws -> AudioObjectID?
Parameters
uid
The UID of the desired box
-
Returns the
AudioObjectID
for the audio clock device withuid
ornil
if unknownRemark
This corresponds to the propertykAudioHardwarePropertyTranslateUIDToClockDevice
Declaration
Swift
public func clockDeviceID(forUID uid: String) throws -> AudioObjectID?
Parameters
uid
The UID of the desired clock device
-
Returns
true
if the current process contains the master HAL instanceRemark
This corresponds to the propertykAudioHardwarePropertyProcessIsMaster
Declaration
Swift
public func processIsMaster() throws -> Bool
-
Returns
true
if the HAL is initing or exiting the processRemark
This corresponds to the propertykAudioHardwarePropertyIsInitingOrExiting
Declaration
Swift
public func isInitingOrExiting() throws -> Bool
-
Informs the HAL the effective user id of the process has changed
Remark
This corresponds to the propertykAudioHardwarePropertyUserIDChanged
Declaration
Swift
public func setUserIDChanged() throws
-
Returns
true
if the process will be heardRemark
This corresponds to the propertykAudioHardwarePropertyProcessIsAudible
Declaration
Swift
public func processIsAudible() throws -> Bool
-
Sets whether the process is audible
Remark
This corresponds to the propertykAudioHardwarePropertyProcessIsAudible
Declaration
Swift
public func setProcessIsAudible(_ value: Bool) throws
-
Returns
true
if the process will allow the CPU to sleep while audio IO is in progressRemark
This corresponds to the propertykAudioHardwarePropertySleepingIsAllowed
Declaration
Swift
public func sleepingIsAllowed() throws -> Bool
-
Sets whether the process will allow the CPU to sleep while audio IO is in progress
Remark
This corresponds to the propertykAudioHardwarePropertySleepingIsAllowed
Declaration
Swift
public func setSleepingIsAllowed(_ value: Bool) throws
-
Returns
true
if the process should be unloaded after a period of inactivityRemark
This corresponds to the propertykAudioHardwarePropertyUnloadingIsAllowed
Declaration
Swift
public func unloadingIsAllowed() throws -> Bool
-
Sets whether the process should be unloaded after a period of inactivity
Remark
This corresponds to the propertykAudioHardwarePropertyUnloadingIsAllowed
Declaration
Swift
public func setUnloadingIsAllowed(_ value: Bool) throws
-
Returns
true
if the HAL should automatically take hog mode on behalf of the processRemark
This corresponds to the propertykAudioHardwarePropertyHogModeIsAllowed
Declaration
Swift
public func hogModeIsAllowed() throws -> Bool
-
Sets whether the HAL should automatically take hog mode on behalf of the process
Remark
This corresponds to the propertykAudioHardwarePropertyHogModeIsAllowed
Declaration
Swift
public func setHogModeIsAllowed(_ value: Bool) throws
-
Returns
true
if the login session of the user is a console or headless sessionRemark
This corresponds to the propertykAudioHardwarePropertyUserSessionIsActiveOrHeadless
Declaration
Swift
public func userSessionIsActiveOrHeadless() throws -> Bool
-
Returns the power hint
Remark
This corresponds to the propertykAudioHardwarePropertyPowerHint
Declaration
Swift
public func powerHint() throws -> AudioHardwarePowerHint
-
Sets the power hint
Remark
This corresponds to the propertykAudioHardwarePropertyPowerHint
Declaration
Swift
public func setPowerHint(_ value: AudioHardwarePowerHint) throws
-
Returns
true
ifself
hasselector
Declaration
Swift
public func hasSelector(_ selector: AudioObjectSelector<AudioSystemObject>) -> Bool
Parameters
selector
The selector of the desired property
-
Returns
true
ifselector
is settableThrows
An error ifself
does not have the requested propertyDeclaration
Swift
public func isSelectorSettable(_ selector: AudioObjectSelector<AudioSystemObject>) throws -> Bool
Parameters
selector
The selector of the desired property
-
Registers
block
to be performed whenselector
changesThrows
An error if the property listener could not be registeredDeclaration
Swift
public func whenSelectorChanges(_ selector: AudioObjectSelector<AudioSystemObject>, perform block: PropertyChangeNotificationBlock?) throws
Parameters
selector
The selector of the desired property
block
A closure to invoke when the property changes or
nil
to remove the previous value