AudioQueueFlush

Function AudioQueueFlush 

Source
pub unsafe extern "C-unwind" fn AudioQueueFlush(
    in_aq: AudioQueueRef,
) -> i32
Available on crate feature AudioQueue only.
Expand description

Resets the audio queue’s decoder state.

After all queued buffers have been played, the function cleans up all decoder state information. You must call this function following a sequence of buffers of encoded audio; otherwise, some of the audio might not play in the next set of queued buffers. The only time it is not necessary to call AudioQueueFlush is following AudioQueueStop with inImmediate=false. (This action internally calls AudioQueueFlush.)

Also, you might wish to call this function before calling AudioQueueStop depending on whether you want to stop immediately regardless of what has played or whether you want to ensure that all buffered data and all data that is in the middle of processing gets recorded or played before stopping.

Parameter inAQ: The audio queue to be flushed.

Returns: An OSStatus result code.

§Safety

in_aq must be a valid pointer.