AudioBox

public class AudioBox : AudioObject

A HAL audio box object

This class has a single scope (kAudioObjectPropertyScopeGlobal) and a single element (kAudioObjectPropertyElementMaster)

Remark

This class correponds to objects with base class kAudioBoxClassID
  • Returns the available audio boxes

    Remark

    This corresponds to the propertykAudioHardwarePropertyBoxList on kAudioObjectSystemObject

    Declaration

    Swift

    public class func boxes() throws -> [AudioBox]
  • Returns an initialized AudioBox with uid or nil if unknown

    Remark

    This corresponds to the property kAudioHardwarePropertyTranslateUIDToBox on kAudioObjectSystemObject

    Declaration

    Swift

    public class func makeBox(forUID uid: String) throws -> AudioBox?

    Parameters

    uid

    The UID of the desired box

  • Undocumented

    Declaration

    Swift

    public override var debugDescription: String { get }
  • Returns the box UID

    Remark

    This corresponds to the property kAudioBoxPropertyBoxUID

    Declaration

    Swift

    public func boxUID() throws -> String
  • Returns the transport type

    Remark

    This corresponds to the property kAudioBoxPropertyTransportType

    Declaration

    Swift

    public func transportType() throws -> AudioDevice.TransportType
  • Returns true if the box has audio

    Remark

    This corresponds to the property kAudioBoxPropertyHasAudio

    Declaration

    Swift

    public func hasAudio() throws -> Bool
  • Returns true if the box has video

    Remark

    This corresponds to the property kAudioBoxPropertyHasVideo

    Declaration

    Swift

    public func hasVideo() throws -> Bool
  • Returns true if the box has MIDI

    Remark

    This corresponds to the property kAudioBoxPropertyHasMIDI

    Declaration

    Swift

    public func hasMIDI() throws -> Bool
  • Returns true if the box is acquired

    Remark

    This corresponds to the property kAudioBoxPropertyAcquired

    Declaration

    Swift

    public func acquired() throws -> Bool
  • Returns the audio devices provided by the box

    Remark

    This corresponds to the property kAudioBoxPropertyDeviceList

    Declaration

    Swift

    public func deviceList() throws -> [AudioDevice]
  • Returns the audio clock devices provided by the box

    Remark

    This corresponds to the property kAudioBoxPropertyClockDeviceList

    Declaration

    Swift

    public func clockDeviceList() throws -> [AudioClockDevice]
  • Returns true if self has selector

    Declaration

    Swift

    public func hasSelector(_ selector: AudioObjectSelector<AudioBox>) -> 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<AudioBox>) 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<AudioBox>, 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