---
title: "AudioQueueAllocateBuffer(_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/audioqueueallocatebuffer(_:_:_:)"
---

# AudioQueueAllocateBuffer(_:_:_:)

Asks an audio queue object to allocate an audio queue buffer.

## Declaration

```swift
func AudioQueueAllocateBuffer(_ inAQ: AudioQueueRef, _ inBufferByteSize: UInt32, _ outBuffer: UnsafeMutablePointer<AudioQueueBufferRef?>) -> OSStatus
```

## Parameters

- `inAQ`: The audio queue you want to allocate a buffer.
- `inBufferByteSize`: The desired capacity of the new buffer, in bytes. Appropriate capacity depends on the processing you will perform on the data as well as on the audio data format.
- `outBuffer`: On output, points to the newly allocated audio queue buffer.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion Once allocated, the pointer to the audio queue buffer and the buffer’s capacity cannot be changed. The buffer’s size field, mAudioDataByteSize, which indicates the amount of valid data, is initially set to 0.

## See Also

### Handling Audio Queue Buffers

- [AudioQueueAllocateBufferWithPacketDescriptions(_:_:_:_:)](audiotoolbox/audioqueueallocatebufferwithpacketdescriptions(_:_:_:_:).md)
- [AudioQueueFreeBuffer(_:_:)](audiotoolbox/audioqueuefreebuffer(_:_:).md)
- [AudioQueueEnqueueBuffer(_:_:_:_:)](audiotoolbox/audioqueueenqueuebuffer(_:_:_:_:).md)
- [AudioQueueEnqueueBufferWithParameters(_:_:_:_:_:_:_:_:_:_:)](audiotoolbox/audioqueueenqueuebufferwithparameters(_:_:_:_:_:_:_:_:_:_:).md)
