AudioEndpointDevice

public class AudioEndpointDevice : AudioDevice

A HAL audio endpoint device

Remark

This class correponds to objects with base class kAudioEndPointDeviceClassID
  • Returns the composition

    Remark

    This corresponds to the property kAudioEndPointDevicePropertyComposition

    Declaration

    Swift

    public func composition() throws -> [AnyHashable : Any]
  • Returns the audio endpoints owned by self

    Remark

    This corresponds to the property kAudioEndPointDevicePropertyEndPointList

    Declaration

    Swift

    public func endpointList() throws -> [AudioEndpoint]
  • Returns the owning pid_tor 0 for public devices

    Remark

    This corresponds to the property kAudioEndPointDevicePropertyIsPrivate

    Declaration

    Swift

    public func isPrivate() throws -> pid_t
  • Returns true if self has selector in scope on element

    Declaration

    Swift

    public func hasSelector(_ selector: AudioObjectSelector<AudioEndpointDevice>, inScope scope: PropertyScope = .global, onElement element: PropertyElement = .master) -> Bool

    Parameters

    selector

    The selector of the desired property

    scope

    The desired scope

    element

    The desired element

  • Returns true if selector in scope on element is settable

    Throws

    An error if self does not have the requested property

    Declaration

    Swift

    public func isSelectorSettable(_ selector: AudioObjectSelector<AudioEndpointDevice>, inScope scope: PropertyScope = .global, onElement element: PropertyElement = .master) throws -> Bool

    Parameters

    selector

    The selector of the desired property

    scope

    The desired scope

    element

    The desired element

  • Registers block to be performed when selector in scope on element changes

    Throws

    An error if the property listener could not be registered

    Declaration

    Swift

    public func whenSelectorChanges(_ selector: AudioObjectSelector<AudioEndpointDevice>, inScope scope: PropertyScope = .global, onElement element: PropertyElement = .master, perform block: PropertyChangeNotificationBlock?) throws

    Parameters

    selector

    The selector of the desired property

    scope

    The desired scope

    element

    The desired element

    block

    A closure to invoke when the property changes or nil to remove the previous value