---
title: "AudioQueueDeviceGetNearestStartTime(_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/audioqueuedevicegetneareststarttime(_:_:_:)"
---

# AudioQueueDeviceGetNearestStartTime(_:_:_:)

Gets the start time, for an audio hardware device, that is closest to a requested start time.

## Declaration

```swift
func AudioQueueDeviceGetNearestStartTime(_ inAQ: AudioQueueRef, _ ioRequestedStartTime: UnsafeMutablePointer<AudioTimeStamp>, _ inFlags: UInt32) -> OSStatus
```

## Parameters

- `inAQ`: The audio queue whose associated audio hardware device’s start time you want to get.
- `ioRequestedStartTime`: On input, the requested start time. On output, the actual start time.
- `inFlags`: Reserved for future use. Pass 0.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion This function asks an audio queue’s associated device for a start time to use for recording or playback. The time returned will be equal to or later than the requested start time, depending on device and system factors. For example, the start time might be shifted to allow for aligning buffer access. The device must be running to use this function.

## See Also

### Managing the Timeline

- [AudioQueueCreateTimeline(_:_:)](audiotoolbox/audioqueuecreatetimeline(_:_:).md)
- [AudioQueueDisposeTimeline(_:_:)](audiotoolbox/audioqueuedisposetimeline(_:_:).md)
- [AudioQueueDeviceGetCurrentTime(_:_:)](audiotoolbox/audioqueuedevicegetcurrenttime(_:_:).md)
- [AudioQueueDeviceTranslateTime(_:_:_:)](audiotoolbox/audioqueuedevicetranslatetime(_:_:_:).md)
- [AudioQueueGetCurrentTime(_:_:_:_:)](audiotoolbox/audioqueuegetcurrenttime(_:_:_:_:).md)
- [AudioQueueTimelineRef](audiotoolbox/audioqueuetimelineref.md)
