<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVReadOnlyAudioPCMBuffer",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "s:8AVFAudio24AVReadOnlyAudioPCMBufferV"
  },
  "title" : "AVReadOnlyAudioPCMBuffer"
}
-->

# AVReadOnlyAudioPCMBuffer

A read-only, Sendable audio buffer for safe concurrent access.

```
struct AVReadOnlyAudioPCMBuffer
```

## Topics

### Creating a read-only buffer

[`init(copying: AVAudioPCMBuffer)`](/documentation/AVFAudio/AVReadOnlyAudioPCMBuffer/init(copying:))

Creates a read-only buffer by copying audio data from an existing PCM buffer.

[`init(format: AVAudioFormat, frameCapacity: Int, initializingWith: (UnsafeMutablePointer<AudioBufferList>) throws -> Void) throws`](/documentation/AVFAudio/AVReadOnlyAudioPCMBuffer/init(format:frameCapacity:initializingWith:))

Creates a read-only buffer by allocating and initializing audio data via closure.

[`init(unsafeRetaining: sending AVAudioPCMBuffer)`](/documentation/AVFAudio/AVReadOnlyAudioPCMBuffer/init(unsafeRetaining:))

Creates a read-only buffer by retaining the existing PCM buffer without copying.

### Getting buffer properties

[`var format: AVAudioFormat`](/documentation/AVFAudio/AVReadOnlyAudioPCMBuffer/format)

[`var frameCapacity: Int`](/documentation/AVFAudio/AVReadOnlyAudioPCMBuffer/frameCapacity)

[`var frameLength: Int`](/documentation/AVFAudio/AVReadOnlyAudioPCMBuffer/frameLength)

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

### Accessing channel data

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

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

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

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

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

Represents read-only channel data.

## Relationships

### Conforms To

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

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

---

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)