AudioQueueFlush(_:)
Resets an audio queue’s decoder state.
Declaration
func AudioQueueFlush(_ inAQ: AudioQueueRef) -> OSStatusParameters
- inAQ:
The audio queue to flush.
Return Value
A result code. See Result Codes.
Discussion
Call AudioQueueFlush(_:) after enqueuing the last audio queue buffer to ensure that all buffered data, as well as all audio data in the midst of processing, gets recorded or played. If you do not call this function, stale data in the audio queue’s decoder may interfere with playback or recording of the next set of buffers.
Call this function before calling AudioQueueStop(_:_:) if you want to ensure that all enqueued data reaches the destination. If you call AudioQueueStop(_:_:) with the inImmediate parameter set to false, calling this function does nothing; under those conditions, AudioQueueStop(_:_:) calls this function.