---
title: "AudioQueuePrime(_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/audioqueueprime(_:_:_:)"
---

# AudioQueuePrime(_:_:_:)

Decodes enqueued buffers in preparation for playback.

## Declaration

```swift
func AudioQueuePrime(_ inAQ: AudioQueueRef, _ inNumberOfFramesToPrepare: UInt32, _ outNumberOfFramesPrepared: UnsafeMutablePointer<UInt32>?) -> OSStatus
```

## Parameters

- `inAQ`: The audio queue to be primed.
- `inNumberOfFramesToPrepare`: The number of frames to decode before returning. Pass 0 to decode all enqueued buffers.
- `outNumberOfFramesPrepared`: On output, the number of frames actually decoded and prepared for playback. Pass NULL on input if you you are not interested in this information.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion This function decodes enqueued buffers in preparation for playback. It returns when at least the number of audio sample frames specified in inNumberOfFramesToPrepare are decoded and ready to play, or (if you pass 0 for the inNumberOfFramesToPrepare parameter), when all enqueued buffers are decoded. To make a buffer of audio data ready to play, use AudioQueuePrime(_:_:_:) as follows: Call AudioQueueEnqueueBuffer(_:_:_:_:). Call AudioQueuePrime(_:_:_:). Call AudioQueueStart(_:_:).

## See Also

### Controlling Audio Queues

- [AudioQueueStart(_:_:)](audiotoolbox/audioqueuestart(_:_:).md)
- [AudioQueueFlush(_:)](audiotoolbox/audioqueueflush(_:).md)
- [AudioQueueStop(_:_:)](audiotoolbox/audioqueuestop(_:_:).md)
- [AudioQueuePause(_:)](audiotoolbox/audioqueuepause(_:).md)
- [AudioQueueReset(_:)](audiotoolbox/audioqueuereset(_:).md)
