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 id kAudioObjectSystemObject and class kAudioSystemObjectClassID
  • The singleton audio system object

    Declaration

    Swift

    public static var instance: AudioSystemObject
  • Returns the AudioObjectID for the audio device with uid or nil if unknown

    Remark

    This corresponds to the property kAudioHardwarePropertyTranslateUIDToDevice

    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 mono

    Remark

    This corresponds to the property kAudioHardwarePropertyMixStereoToMono

    Declaration

    Swift

    public func mixStereoToMono() throws -> Bool
  • Sets whether audio devices should mix stereo to mono

    Remark

    This corresponds to the property kAudioHardwarePropertyMixStereoToMono

    Declaration

    Swift

    public func setMixStereoToMono(_ value: Bool) throws
  • Returns the AudioObjectID for the audio plug-in for bundleID or nil if unknown

    Remark

    This corresponds to the property kAudioHardwarePropertyTranslateBundleIDToPlugIn

    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 for bundleID or nil if unknown

    Remark

    This corresponds to the property kAudioHardwarePropertyTranslateBundleIDToTransportManager

    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 with uid or nil if unknown

    Remark

    This corresponds to the property kAudioHardwarePropertyTranslateUIDToBox

    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 with uid or nil if unknown

    Remark

    This corresponds to the property kAudioHardwarePropertyTranslateUIDToClockDevice

    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 instance

    Remark

    This corresponds to the property kAudioHardwarePropertyProcessIsMaster

    Declaration

    Swift

    public func processIsMaster() throws -> Bool
  • Returns true if the HAL is initing or exiting the process

    Remark

    This corresponds to the property kAudioHardwarePropertyIsInitingOrExiting

    Declaration

    Swift

    public func isInitingOrExiting() throws -> Bool
  • Informs the HAL the effective user id of the process has changed

    Remark

    This corresponds to the property kAudioHardwarePropertyUserIDChanged

    Declaration

    Swift

    public func setUserIDChanged() throws
  • Returns true if the process will be heard

    Remark

    This corresponds to the property kAudioHardwarePropertyProcessIsAudible

    Declaration

    Swift

    public func processIsAudible() throws -> Bool
  • Sets whether the process is audible

    Remark

    This corresponds to the property kAudioHardwarePropertyProcessIsAudible

    Declaration

    Swift

    public func setProcessIsAudible(_ value: Bool) throws
  • Returns true if the process will allow the CPU to sleep while audio IO is in progress

    Remark

    This corresponds to the property kAudioHardwarePropertySleepingIsAllowed

    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 property kAudioHardwarePropertySleepingIsAllowed

    Declaration

    Swift

    public func setSleepingIsAllowed(_ value: Bool) throws
  • Returns true if the process should be unloaded after a period of inactivity

    Remark

    This corresponds to the property kAudioHardwarePropertyUnloadingIsAllowed

    Declaration

    Swift

    public func unloadingIsAllowed() throws -> Bool
  • Sets whether the process should be unloaded after a period of inactivity

    Remark

    This corresponds to the property kAudioHardwarePropertyUnloadingIsAllowed

    Declaration

    Swift

    public func setUnloadingIsAllowed(_ value: Bool) throws
  • Returns true if the HAL should automatically take hog mode on behalf of the process

    Remark

    This corresponds to the property kAudioHardwarePropertyHogModeIsAllowed

    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 property kAudioHardwarePropertyHogModeIsAllowed

    Declaration

    Swift

    public func setHogModeIsAllowed(_ value: Bool) throws
  • Returns true if the login session of the user is a console or headless session

    Remark

    This corresponds to the property kAudioHardwarePropertyUserSessionIsActiveOrHeadless

    Declaration

    Swift

    public func userSessionIsActiveOrHeadless() throws -> Bool
  • Returns the power hint

    Remark

    This corresponds to the property kAudioHardwarePropertyPowerHint

    Declaration

    Swift

    public func powerHint() throws -> AudioHardwarePowerHint
  • Sets the power hint

    Remark

    This corresponds to the property kAudioHardwarePropertyPowerHint

    Declaration

    Swift

    public func setPowerHint(_ value: AudioHardwarePowerHint) throws
  • Returns true if self has selector

    Declaration

    Swift

    public func hasSelector(_ selector: AudioObjectSelector<AudioSystemObject>) -> Bool

    Parameters

    selector

    The selector of the desired property

  • Returns true if selector is settable

    Throws

    An error if self does not have the requested property

    Declaration

    Swift

    public func isSelectorSettable(_ selector: AudioObjectSelector<AudioSystemObject>) throws -> Bool

    Parameters

    selector

    The selector of the desired property

  • Registers block to be performed when selector changes

    Throws

    An error if the property listener could not be registered

    Declaration

    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