<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioPCMBuffer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioPCMBuffer"
  },
  "title" : "AVAudioPCMBuffer"
}
-->

# AVAudioPCMBuffer

An object that represents an audio buffer you use with PCM audio formats.

```
class AVAudioPCMBuffer
```

## Overview

The PCM buffer class provides methods that are useful for manipulating buffers of audio in PCM format.

## Topics

### Creating a PCM audio buffer

[`init?(pcmFormat: AVAudioFormat, frameCapacity: AVAudioFrameCount)`](/documentation/AVFAudio/AVAudioPCMBuffer/init(pcmFormat:frameCapacity:)-5jhd5)

Creates a PCM audio buffer instance for PCM audio data.

[`init?(pcmFormat: AVAudioFormat, bufferListNoCopy: UnsafePointer<AudioBufferList>, deallocator: ((UnsafePointer<AudioBufferList>) -> Void)?)`](/documentation/AVFAudio/AVAudioPCMBuffer/init(pcmFormat:bufferListNoCopy:deallocator:)-9iwe7)

Creates a PCM audio buffer instance without copying samples, for PCM audio data, with a specified buffer list and a deallocator closure.

[`convenience init(copying: AVAudioPCMBuffer)`](/documentation/AVFAudio/AVAudioPCMBuffer/init(copying:)-68es5)

Creates a mutable buffer by copying another PCM buffer’s audio data.

[`convenience init(copying: AVReadOnlyAudioPCMBuffer)`](/documentation/AVFAudio/AVAudioPCMBuffer/init(copying:)-875xm)

Creates a mutable buffer by copying a read-only buffer’s audio data.

### Managing the frame length

[`var frameLength: AVAudioFrameCount`](/documentation/AVFAudio/AVAudioPCMBuffer/frameLength)

The current number of valid sample frames in the buffer.

### Accessing PCM buffer data

[`func channelData(Int) -> AVAudioPCMBuffer.ChannelData`](/documentation/AVFAudio/AVAudioPCMBuffer/channelData(_:))

Returns read-only access to a specific channel’s data.

[`func mutableChannelData(Int) -> AVAudioPCMBuffer.MutableChannelData`](/documentation/AVFAudio/AVAudioPCMBuffer/mutableChannelData(_:))

Returns mutable access to a specific channel’s data.

[`func withUnsafeAudioBufferList<R>((UnsafePointer<AudioBufferList>) throws -> R) rethrows -> R`](/documentation/AVFAudio/AVAudioPCMBuffer/withUnsafeAudioBufferList(_:))

Provides scoped read-only access to the audio buffer list.

[`var floatChannelData: UnsafePointer<UnsafeMutablePointer<Float>>?`](/documentation/AVFAudio/AVAudioPCMBuffer/floatChannelData)

The buffer’s audio samples as floating point values.

[`var frameCapacity: AVAudioFrameCount`](/documentation/AVFAudio/AVAudioPCMBuffer/frameCapacity)

The buffer’s capacity, in audio sample frames.

[`var int16ChannelData: UnsafePointer<UnsafeMutablePointer<Int16>>?`](/documentation/AVFAudio/AVAudioPCMBuffer/int16ChannelData)

The buffer’s 16-bit integer audio samples.

[`var int32ChannelData: UnsafePointer<UnsafeMutablePointer<Int32>>?`](/documentation/AVFAudio/AVAudioPCMBuffer/int32ChannelData)

The buffer’s 32-bit integer audio samples.

[`var stride: Int`](/documentation/AVFAudio/AVAudioPCMBuffer/stride)

The buffer’s number of interleaved channels.

[`enum ChannelData`](/documentation/AVFAudio/AVAudioPCMBuffer/ChannelData)

Represents read-only channel data.

[`enum MutableChannelData`](/documentation/AVFAudio/AVAudioPCMBuffer/MutableChannelData)

Represents mutable channel data.

### Initializers

[`init?(PCMFormat: AVAudioFormat, bufferListNoCopy: UnsafePointer<AudioBufferList>, deallocator: ((UnsafePointer<AudioBufferList>) -> Void)?)`](/documentation/AVFAudio/AVAudioPCMBuffer/init(PCMFormat:bufferListNoCopy:deallocator:)-2ms1j)

[`init?(PCMFormat: AVAudioFormat, frameCapacity: AVAudioFrameCount)`](/documentation/AVFAudio/AVAudioPCMBuffer/init(PCMFormat:frameCapacity:)-7scyk)

## Relationships

### Conforms To

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

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

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

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

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

[`NSCopying`](/documentation/Foundation/NSCopying)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSMutableCopying`](/documentation/Foundation/NSMutableCopying)

### Inherits From

[`AVAudioBuffer`](/documentation/AVFAudio/AVAudioBuffer)

---

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)