stop

fun stop(inImmediate: Boolean = true)

Stops playing or recording audio.

Per Apple Audio Queue Services Reference: AudioQueueStop also resets the queue. With inImmediate true, stopping is synchronous; with false, callbacks may continue until queued buffers finish.

For immediate stop we clear the running flag first so in-flight callbacks skip enqueue (see Recording Audio Listing 2-5 / 2-14).

Parameters

inImmediate

If you pass true, stopping occurs immediately (that is, synchronously). If you pass false, the function returns immediately, but the audio queue does not stop until its queued buffers are played or recorded (that is, the stop occurs asynchronously). Audio queue callbacks are invoked as necessary until the queue actually stops.