AudioClockDevice

public class AudioClockDevice : AudioObject

A HAL audio clock device object

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

Remark

This class correponds to objects with base class kAudioClockDeviceClassID
  • Returns the available audio clock devices

    Remark

    This corresponds to the propertykAudioHardwarePropertyClockDeviceList on kAudioObjectSystemObject

    Declaration

    Swift

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

    Remark

    This corresponds to the property kAudioHardwarePropertyTranslateUIDToClockDevice on kAudioObjectSystemObject

    Declaration

    Swift

    public class func makeClockDevice(forUID uid: String) throws -> AudioClockDevice?

    Parameters

    uid

    The UID of the desired clock device

  • Returns the clock device UID

    Remark

    This corresponds to the property kAudioClockDevicePropertyDeviceUID

    Declaration

    Swift

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

    Remark

    This corresponds to the property kAudioClockDevicePropertyTransportType

    Declaration

    Swift

    public func transportType() throws -> AudioDevice.TransportType
  • Returns the domain

    Remark

    This corresponds to the property kAudioClockDevicePropertyClockDomain

    Declaration

    Swift

    public func domain() throws -> UInt32
  • Returns true if the clock device is alive

    Remark

    This corresponds to the property kAudioClockDevicePropertyDeviceIsAlive

    Declaration

    Swift

    public func isAlive() throws -> Bool
  • Returns true if the clock device is running

    Remark

    This corresponds to the property kAudioClockDevicePropertyClockDomain

    Declaration

    Swift

    public func isRunning() throws -> Bool
  • Returns the latency

    Remark

    This corresponds to the property kAudioClockDevicePropertyDeviceIsRunning

    Declaration

    Swift

    public func latency() throws -> UInt32
  • Returns the audio controls owned by self

    Remark

    This corresponds to the property kAudioClockDevicePropertyControlList

    Declaration

    Swift

    public func controlList() throws -> [AudioControl]
  • Returns the sample rate

    Remark

    This corresponds to the property kAudioClockDevicePropertyNominalSampleRate

    Declaration

    Swift

    public func sampleRate() throws -> Double
  • Returns the available sample rates

    Remark

    This corresponds to the property kAudioClockDevicePropertyAvailableNominalSampleRates

    Declaration

    Swift

    public func availableSampleRates() throws -> [ClosedRange<Double>]
  • Returns true if self has selector

    Declaration

    Swift

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