AudioDeviceGetNearestStartTime(_:_:_:)
Declaration
func AudioDeviceGetNearestStartTime(_ inDevice: AudioObjectID, _ ioRequestedStartTime: UnsafeMutablePointer<AudioTimeStamp>, _ inFlags: UInt32) -> OSStatusParameters
- inDevice:
The AudioDevice to query.
- ioRequestedStartTime:
A pointer to an AudioTimeStamp that, on entry, is the requested start time. On exit, it will have the a time equal to or later than the requested time, as dictated by the device’s constraints.
- inFlags:
A UInt32 containing flags that modify how this function behaves.
Return Value
An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be returned if the AudioDevice isn’t running. kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does not support starting at a specific time.
Discussion
Query an AudioDevice to get a time equal to or later than the given time that is the best time to start IO.
The time that is returned is dictated by the constraints of the device and the system. For instance, the driver of a device that provides both audio and video data may only allow start times that coincide with the edge of a video frame. Also, if the device already has one or more active IOProcs, the start time will be shifted to the beginning of the next IO cycle so as not to cause discontinuities in the existing IOProcs. Another reason the start time may shift is to allow for aligning the buffer accesses in an optimal fashion. Note that the device must be running to use this function.
See Also
Functions
AudioConvertHostTimeToNanos(_:)AudioConvertNanosToHostTime(_:)AudioDeviceCreateIOProcID(_:_:_:_:)AudioDeviceCreateIOProcIDWithBlock(_:_:_:_:)AudioDeviceDestroyIOProcID(_:_:)AudioDeviceGetCurrentTime(_:_:)AudioDeviceStart(_:_:)AudioDeviceStartAtTime(_:_:_:_:)AudioDeviceStop(_:_:)AudioDeviceTranslateTime(_:_:_:)AudioGetCurrentHostTime()AudioGetHostClockFrequency()AudioGetHostClockMinimumTimeDelta()AudioHardwareCreateAggregateDevice(_:_:)AudioHardwareDestroyAggregateDevice(_:)