---
title: "CMAudioDeviceClockCreateFromAudioDeviceID(allocator:deviceID:clockOut:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmaudiodeviceclockcreatefromaudiodeviceid(allocator:deviceid:clockout:)"
---

# CMAudioDeviceClockCreateFromAudioDeviceID(allocator:deviceID:clockOut:)

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

## Declaration

```swift
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

Overview important: In Objective-C, you’re responsible for calling CFRelease to release the clock returned in clockOut.

## See Also

### Creating Audio Clocks

- [CMAudioClockCreate(allocator:clockOut:)](coremedia/cmaudioclockcreate(allocator:clockout:).md)
- [CMAudioDeviceClockCreate(allocator:deviceUID:clockOut:)](coremedia/cmaudiodeviceclockcreate(allocator:deviceuid:clockout:).md)
