<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AudioQueueOutputCallback",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@T@AudioQueueOutputCallback"
  },
  "title" : "AudioQueueOutputCallback"
}
-->

# AudioQueueOutputCallback

Called by the system when an audio queue buffer is available for reuse.

```
typealias AudioQueueOutputCallback = (UnsafeMutableRawPointer?, AudioQueueRef, AudioQueueBufferRef) -> Void
```

## Parameters

`inUserData`

The custom data you’ve specified in the `inUserData` parameter of the [`AudioQueueNewOutput(_:_:_:_:_:_:_:)`](/documentation/AudioToolbox/AudioQueueNewOutput(_:_:_:_:_:_:_:)) function. Typically, this includes data format and state information for the audio queue.

`inAQ`

The playback audio queue that invoked the callback.

`inBuffer`

An audio queue buffer, newly available to fill because the playback audio queue has acquired its contents.

## Discussion

If you name your callback function `MyAudioQueueOutputCallback`, you would declare it like this:

### Discussion

This callback function is invoked each time its associated playback audio queue has acquired the data from an audio queue buffer, at which point the buffer is available for reuse. The newly-available buffer is sent to this callback in the `inBuffer` parameter. Typically, you write this callback to:

1. Fill the newly-available buffer with the next set of audio data from a file or other buffer.
2. Reenqueue the buffer for playback. To reenqueue a buffer, use the [`AudioQueueEnqueueBuffer(_:_:_:_:)`](/documentation/AudioToolbox/AudioQueueEnqueueBuffer(_:_:_:_:)) or [`AudioQueueEnqueueBufferWithParameters(_:_:_:_:_:_:_:_:_:_:)`](/documentation/AudioToolbox/AudioQueueEnqueueBufferWithParameters(_:_:_:_:_:_:_:_:_:_:)) function.

To associate this callback with a playback audio queue, provide a reference to the callback as you are creating the audio queue. See the `inCallbackProc` parameter of the [`AudioQueueNewOutput(_:_:_:_:_:_:_:)`](/documentation/AudioToolbox/AudioQueueNewOutput(_:_:_:_:_:_:_:)) function.

When the system invokes this callback, you cannot assume that the audio data from the newly-available buffer has been played. For a description of how to check that a sound has finished playing, read the Discussion for the [`AudioQueuePropertyListenerProc`](/documentation/AudioToolbox/AudioQueuePropertyListenerProc) callback function.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)