<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAudioTypes",
  "identifier" : "/documentation/CoreAudioTypes/AudioBuffer",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Audio Types"
    ],
    "preciseIdentifier" : "c:@S@AudioBuffer"
  },
  "title" : "AudioBuffer"
}
-->

# AudioBuffer

A structure that holds a buffer of audio data.

```
struct AudioBuffer
```

## Overview

An audio buffer holds a single buffer of audio data in its [`mData`](/documentation/CoreAudioTypes/AudioBuffer/mData) field. The buffer can represent two types of audio:

- A single, monophonic, noninterleaved channel of audio
- Interleaved audio with the number of channels set by the [`mNumberChannels`](/documentation/CoreAudioTypes/AudioBuffer/mNumberChannels) field

> Note:
> The ``doc://com.apple.coreaudiotypes/documentation/CoreAudioTypes/AudioStreamPacketDescription/mDataByteSize`` and ``doc://com.apple.coreaudiotypes/documentation/CoreAudioTypes/AudioBuffer/mNumberChannels`` parameters needs to match the memory layout of ``doc://com.apple.coreaudiotypes/documentation/CoreAudioTypes/AudioBuffer/mData``, so update the size and number of channels when you update the data field.

## Topics

### Creating a Buffer

[`init()`](/documentation/CoreAudioTypes/AudioBuffer/init())

Creates an empty audio buffer.

[`init(mNumberChannels:mDataByteSize:mData:)`](/documentation/CoreAudioTypes/AudioBuffer/init(mNumberChannels:mDataByteSize:mData:))

Creates an audio buffer with audio data.

### Accessing the Audio

[`mNumberChannels`](/documentation/CoreAudioTypes/AudioBuffer/mNumberChannels)

The number of interleaved channels in the buffer.

[`mDataByteSize`](/documentation/CoreAudioTypes/AudioBuffer/mDataByteSize)

The number of bytes in the buffer.

[`mData`](/documentation/CoreAudioTypes/AudioBuffer/mData)

A pointer to a buffer of audio data.

## Relationships

### Conforms To

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)