<!--
{
  "availability" : [
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMAudioDeviceClockCreateFromAudioDeviceID(allocator:deviceID:clockOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMAudioDeviceClockCreateFromAudioDeviceID"
  },
  "title" : "CMAudioDeviceClockCreateFromAudioDeviceID(allocator:deviceID:clockOut:)"
}
-->

# CMAudioDeviceClockCreateFromAudioDeviceID(allocator:deviceID:clockOut:)

Creates a clock that tracks playback through a Core Audio device with the specified identifier.

```
func CMAudioDeviceClockCreateFromAudioDeviceID(allocator: CFAllocator?, deviceID: AudioDeviceID, clockOut: UnsafeMutablePointer<CMClock?>) -> OSStatus
```

## Parameters

`allocator`

Allocator for the new clock; pass <doc://com.apple.documentation/documentation/CoreFoundation/kCFAllocatorDefault> or `NULL` to use the default allocator.

`deviceID`

The <doc://com.apple.documentation/documentation/CoreAudio/AudioDeviceID> of the device for which to create a clock.

`clockOut`

Upon return, a pointer to the newly created clock.

## Overview

> Important: In Objective-C, you’re responsible for calling <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> to release the clock returned in `clockOut`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)