<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMReadySampleBuffer/copyPCMData(fromRange:into:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Media",
      "CoreMedia"
    ],
    "preciseIdentifier" : "s:9CoreMedia19CMReadySampleBufferVA2A019CMReadOnlyDataBlockE0VRszrlE11copyPCMData9fromRange4intoySnySiG_SpySo05AudioE4ListVGtKF"
  },
  "title" : "copyPCMData(fromRange:into:)"
}
-->

# copyPCMData(fromRange:into:)

Copies PCM audio data from the sample buffer into a pre-allocated `AudioBufferList`.

```
func copyPCMData(fromRange range: Range<Int>, into bufferList: UnsafeMutablePointer<AudioBufferList>) throws
```

## Parameters

`range`

Range of frames to copy.

`bufferList`

Pre-allocated `AudioBufferList`.

## Discussion

The `AudioBufferList` must contain the same number of channels and its data buffers must be sized to hold the
specified number of frames.

> Throws: ``CMSampleBuffer.Error.sampleIndexOutOfRange`` if the range does not fit in the sample buffer or if
> the bufferList does not have enough capacity.

---

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)