AudioQueueOfflineRender(_:_:_:_:)
Exports audio to a buffer, instead of to a device, using a playback audio queue.
Declaration
func AudioQueueOfflineRender(_ inAQ: AudioQueueRef, _ inTimestamp: UnsafePointer<AudioTimeStamp>, _ ioBuffer: AudioQueueBufferRef, _ inNumberFrames: UInt32) -> OSStatusParameters
- inAQ:
The playback audio queue.
- inTimestamp:
The time corresponding to the beginning of the current audio queue buffer. This function uses the
mSampleTimefield of the Audiotimestamp data structure. - ioBuffer:
On input, a buffer you supply to hold rendered audio data. On output, the rendered audio data, which you can then write to a file.
- inNumberFrames:
The number of frames of audio to render.
Return Value
A result code. See Result Codes.
Discussion
When you change a playback audio queue’s rendering mode to offline, using the AudioQueueSetOfflineRenderFormat(_:_:_:) function, you gain access to the rendered audio. You can then write the audio to a file, rather than have it play to external hardware such as a loudspeaker.