             return nil
         }
 
-        return clockSourceNameForClockSourceID(sourceID, forChannel: channel, andDirection: direction)
+        return sourceID
+    }
+
+    /**
+        The clock source name for the channel number and direction specified.
+
+        - Returns: *(optional)* A `String` containing the clock source name.
+     */
+    public func clockSourceForChannel(channel: UInt32, andDirection direction: Direction) -> String? {
+        if let sourceID = clockSourceIDForChannel(channel, andDirection: direction) {
+            return clockSourceNameForClockSourceID(sourceID, forChannel: channel, andDirection: direction)
+        }
+
+        return nil
+    }
+
+    /**
+        A list of clock source identifiers for the channel number and direction specified.
+
+        - Returns: *(optional)* A `UInt32` array containing all the clock source identifiers.
+     */
+    public func clockSourceIDsForChannel(channel: UInt32, andDirection direction: Direction) -> [UInt32]? {
+        var address = AudioObjectPropertyAddress(
+            mSelector: kAudioDevicePropertyClockSources,
+            mScope: directionToScope(direction),
+            mElement: channel
+        )
+
+        if !AudioObjectHasProperty(deviceID, &address) {
+            return nil
+        }
+
+        var clockSourceIDs = [UInt32]()
+        let status = getPropertyDataArray(address, value: &clockSourceIDs, andDefaultValue: 0)
+
+        if noErr != status {
+            return nil
+        }
+
+        return clockSourceIDs
     }
 
     /**

            return nil
        }

        var clockSourceIDs = [UInt32]()
        let status = getPropertyDataArray(address, value: &clockSourceIDs, andDefaultValue: 0)

        if noErr != status {
            return nil
        }

        return clockSourceIDs.map { (clockSourceID) -> String in
            // We expect clockSourceNameForClockSourceID to never fail in this case, 
            // but in the unlikely case it does, we provide a default value.
            return clockSourceNameForClockSourceID(clockSourceID, forChannel: channel, andDirection: direction) ?? "Clock source \(clockSourceID)"
        }
    }

    /**
        Sets the clock source for a channel and direction.

        - Returns: `true` on success, `false` otherwise.
     */
    public func setClockSourceID(clockSourceID: UInt32, forChannel channel: UInt32, andDirection direction: Direction) -> Bool {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyClockSource,
            mScope: directionToScope(direction),
            mElement: channel
        )

        var theClockSourceID = clockSourceID
        let status = setPropertyData(address, andValue: &theClockSourceID)

        return noErr == status
    }

    // MARK: - ↹ Latency Functions

    /**
        The latency in frames for the specified direction.

        - Returns: *(optional)* A `UInt32` value with the latency in frames.
     */
    public func deviceLatencyFramesForDirection(direction: Direction) -> UInt32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyLatency,
            mScope: directionToScope(direction),
            mElement: kAudioObjectPropertyElementMaster
        )

        var latencyFrames = UInt32(0)
        let status = getPropertyData(address, andValue: &latencyFrames)

        return noErr == status ? latencyFrames : nil
    }

    /**
        The safety offset frames for the specified direction.

        - Returns: *(optional)* A `UInt32` value with the safety offset in frames.
     */
    public func deviceSafetyOffsetFramesForDirection(direction: Direction) -> UInt32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertySafetyOffset,
            mScope: directionToScope(direction),
            mElement: kAudioObjectPropertyElementMaster
        )

        var safetyOffsetFrames = UInt32(0)
        let status = getPropertyData(address, andValue: &safetyOffsetFrames)

        return noErr == status ? safetyOffsetFrames : nil
    }

    // MARK: - 🐗 Hog Mode Functions

    /**
        Indicates the `pid` that currently owns exclusive access to the audio device or
        a value of `-1` indicating that the device is currently available to all processes.

        - Returns: *(optional)* A `pid_t` value.
     */
    public func hogModePID() -> pid_t? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyHogMode,
            mScope: kAudioObjectPropertyScopeWildcard,
            mElement: kAudioObjectPropertyElementMaster
        )

        var pid = pid_t()
        let status = getPropertyData(address, andValue: &pid)

        return noErr == status ? pid : nil
    }

    /**
        Attempts to set the `pid` that currently owns exclusive access to the
        audio device.

        - Returns: `true` on success, `false` otherwise.
     */
    public func setHogModePID(pid: pid_t) -> Bool {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyHogMode,
            mScope: kAudioObjectPropertyScopeWildcard,
            mElement: kAudioObjectPropertyElementMaster
        )

        var thePID = pid
        let status = setPropertyData(address, andValue: &thePID)

        return noErr == status
    }

    /**
        Attempts to set the `pid` that currently owns exclusive access to the
        audio device to the current process.

        - Returns: `true` on success, `false` otherwise.
     */
    public func setHogModePidToCurrentProcess() -> Bool {
        let currentPID = pid_t(NSProcessInfo.processInfo().processIdentifier)
        return setHogModePID(currentPID)
    }

    /**
        Attempts to make the audio device available to all processes by setting
        the hog mode to `-1`.

        - Returns: `true` on success, `false` otherwise.
     */
    public func unsetHogMode() -> Bool {
        return setHogModePID(pid_t(-1))
    }

    // MARK: - ♺ Volume Conversion Functions

    /**
        Converts a scalar volume to a decibel *(dbFS)* volume
        for the given channel and direction.

        - Returns: *(optional)* A `Float32` value with the scalar volume converted in decibels.
     */
    public func scalarToDecibels(volume: Float32, forChannel channel: UInt32, andDirection direction: Direction) -> Float32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyVolumeScalarToDecibels,
            mScope: directionToScope(direction),
            mElement: channel
        )

        var inOutVolume = volume
        let status = getPropertyData(address, andValue: &inOutVolume)

        return noErr == status ? inOutVolume : nil
    }

    /**
        Converts a relative decibel *(dbFS)* volume to a scalar volume for the given channel and direction.

        - Returns: *(optional)* A `Float32` value with the decibels volume converted to scalar.
     */
    public func decibelsToScalar(volume: Float32, forChannel channel: UInt32, andDirection direction: Direction) -> Float32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyVolumeDecibelsToScalar,
            mScope: directionToScope(direction),
            mElement: channel
        )

        var inOutVolume = volume
        let status = getPropertyData(address, andValue: &inOutVolume)

        return noErr == status ? inOutVolume : nil
    }

    // MARK: - ♨︎ Stream Functions

    /**
        Returns a list of streams for a given direction.

        - Returns: *(optional)* An array of `AMAudioStream` objects.
     */
    public func streamsForDirection(direction: Direction) -> [AMAudioStream]? {
        var address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyStreams,
            mScope: directionToScope(direction),
            mElement: kAudioObjectPropertyElementMaster
        )

        if !AudioObjectHasProperty(deviceID, &address) {
            return nil
        }

        var streamIDs = [AudioStreamID]()
        let status = getPropertyDataArray(address, value: &streamIDs, andDefaultValue: 0)

        if noErr != status {
            return nil
        }

        return streamIDs.map({ (streamID) -> AMAudioStream in
            AMAudioStream.lookupByID(streamID)
        })
    }

    // MARK: - Private Functions

    private func setDefaultDevice(deviceType: AudioObjectPropertySelector) -> Bool {
        let address = AudioObjectPropertyAddress(
            mSelector: deviceType,
            mScope: kAudioObjectPropertyScopeGlobal,
            mElement: kAudioObjectPropertyElementMaster
        )

        var deviceID = self.deviceID
        let status = setPropertyData(AudioObjectID(kAudioObjectSystemObject), address: address, andValue: &deviceID)

        return noErr == status
    }

    private func getDeviceName() -> String {
        var name: CFString = ""

        let address = AudioObjectPropertyAddress(
            mSelector: kAudioObjectPropertyName,
            mScope: kAudioObjectPropertyScopeGlobal,
            mElement: kAudioObjectPropertyElementMaster
        )

        let status = getPropertyData(address, andValue: &name)

        return noErr == status ? (name as String) : (cachedDeviceName ?? "<Unknown Device Name>")
    }

    private func clockSourceNameForClockSourceID(clockSourceID: UInt32, forChannel channel: UInt32, andDirection direction: Direction) -> String? {
        var name: CFString = ""
        var theClockSourceID = clockSourceID


        let status = getPropertyData(address, andValue: &translation)

        return noErr == status ? (name as String) : nil
    }

    /**
        Sets the clock source for a channel and direction.

        - Returns: `true` on success, `false` otherwise.
     */
    public func setClockSourceID(clockSourceID: UInt32, forChannel channel: UInt32, andDirection direction: Direction) -> Bool {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyClockSource,
            mScope: directionToScope(direction),
            mElement: channel
        )

        var theClockSourceID = clockSourceID
        let status = setPropertyData(address, andValue: &theClockSourceID)

        return noErr == status
    }

    // MARK: - ↹ Latency Functions

    /**
        The latency in frames for the specified direction.

        - Returns: *(optional)* A `UInt32` value with the latency in frames.
     */
    public func deviceLatencyFramesForDirection(direction: Direction) -> UInt32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyLatency,
            mScope: directionToScope(direction),
            mElement: kAudioObjectPropertyElementMaster
        )

        var latencyFrames = UInt32(0)
        let status = getPropertyData(address, andValue: &latencyFrames)

        return noErr == status ? latencyFrames : nil
    }

    /**
        The safety offset frames for the specified direction.

        - Returns: *(optional)* A `UInt32` value with the safety offset in frames.
     */
    public func deviceSafetyOffsetFramesForDirection(direction: Direction) -> UInt32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertySafetyOffset,
            mScope: directionToScope(direction),
            mElement: kAudioObjectPropertyElementMaster
        )

        var safetyOffsetFrames = UInt32(0)
        let status = getPropertyData(address, andValue: &safetyOffsetFrames)

        return noErr == status ? safetyOffsetFrames : nil
    }

    // MARK: - 🐗 Hog Mode Functions

    /**
        Indicates the `pid` that currently owns exclusive access to the audio device or
        a value of `-1` indicating that the device is currently available to all processes.

        - Returns: *(optional)* A `pid_t` value.
     */
    public func hogModePID() -> pid_t? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyHogMode,
            mScope: kAudioObjectPropertyScopeWildcard,
            mElement: kAudioObjectPropertyElementMaster
        )

        var pid = pid_t()
        let status = getPropertyData(address, andValue: &pid)

        return noErr == status ? pid : nil
    }

    /**
        Attempts to set the `pid` that currently owns exclusive access to the
        audio device.

        - Returns: `true` on success, `false` otherwise.
     */
    public func setHogModePID(pid: pid_t) -> Bool {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyHogMode,
            mScope: kAudioObjectPropertyScopeWildcard,
            mElement: kAudioObjectPropertyElementMaster
        )

        var thePID = pid
        let status = setPropertyData(address, andValue: &thePID)

        return noErr == status
    }

    /**
        Attempts to set the `pid` that currently owns exclusive access to the
        audio device to the current process.

        - Returns: `true` on success, `false` otherwise.
     */
    public func setHogModePidToCurrentProcess() -> Bool {
        let currentPID = pid_t(NSProcessInfo.processInfo().processIdentifier)
        return setHogModePID(currentPID)
    }

    /**
        Attempts to make the audio device available to all processes by setting
        the hog mode to `-1`.

        - Returns: `true` on success, `false` otherwise.
     */
    public func unsetHogMode() -> Bool {
        return setHogModePID(pid_t(-1))
    }

    // MARK: - ♺ Volume Conversion Functions

    /**
        Converts a scalar volume to a decibel *(dbFS)* volume
        for the given channel and direction.

        - Returns: *(optional)* A `Float32` value with the scalar volume converted in decibels.
     */
    public func scalarToDecibels(volume: Float32, forChannel channel: UInt32, andDirection direction: Direction) -> Float32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyVolumeScalarToDecibels,
            mScope: directionToScope(direction),
            mElement: channel
        )

        var inOutVolume = volume
        let status = getPropertyData(address, andValue: &inOutVolume)

        return noErr == status ? inOutVolume : nil
    }

    /**
        Converts a relative decibel *(dbFS)* volume to a scalar volume for the given channel and direction.

        - Returns: *(optional)* A `Float32` value with the decibels volume converted to scalar.
     */
    public func decibelsToScalar(volume: Float32, forChannel channel: UInt32, andDirection direction: Direction) -> Float32? {
        let address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyVolumeDecibelsToScalar,
            mScope: directionToScope(direction),
            mElement: channel
        )

        var inOutVolume = volume
        let status = getPropertyData(address, andValue: &inOutVolume)

        return noErr == status ? inOutVolume : nil
    }

    // MARK: - ♨︎ Stream Functions

    /**
        Returns a list of streams for a given direction.

        - Returns: *(optional)* An array of `AMAudioStream` objects.
     */
    public func streamsForDirection(direction: Direction) -> [AMAudioStream]? {
        var address = AudioObjectPropertyAddress(
            mSelector: kAudioDevicePropertyStreams,
            mScope: directionToScope(direction),
            mElement: kAudioObjectPropertyElementMaster
        )

        if !AudioObjectHasProperty(deviceID, &address) {
            return nil
        }

        var streamIDs = [AudioStreamID]()
        let status = getPropertyDataArray(address, value: &streamIDs, andDefaultValue: 0)

        if noErr != status {
            return nil
        }

        return streamIDs.map({ (streamID) -> AMAudioStream in
            AMAudioStream.lookupByID(streamID)
        })
    }

    // MARK: - Private Functions

    private func setDefaultDevice(deviceType: AudioObjectPropertySelector) -> Bool {
        let address = AudioObjectPropertyAddress(
            mSelector: deviceType,
            mScope: kAudioObjectPropertyScopeGlobal,
            mElement: kAudioObjectPropertyElementMaster
        )

        var deviceID = self.deviceID
        let status = setPropertyData(AudioObjectID(kAudioObjectSystemObject), address: address, andValue: &deviceID)

        return noErr == status
    }

    private func getDeviceName() -> String {
        var name: CFString = ""

        let address = AudioObjectPropertyAddress(
            mSelector: kAudioObjectPropertyName,
            mScope: kAudioObjectPropertyScopeGlobal,
            mElement: kAudioObjectPropertyElementMaster
        )

        let status = getPropertyData(address, andValue: &name)

        return noErr == status ? (name as String) : (cachedDeviceName ?? "<Unknown Device Name>")
    }

    private class func defaultDeviceOfType(deviceType: AudioObjectPropertySelector) -> AMAudioDevice? {
