---
title: "copyPCMData(fromRange:into:)"
framework: coremedia
role: symbol
role_heading: Instance Method
path: "coremedia/cmreadysamplebuffer/copypcmdata(fromrange:into:)"
---

# copyPCMData(fromRange:into:)

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

## Declaration

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

## Parameters

- `range`: Range of frames to copy.
- `bufferList`: Pre-allocated AudioBufferList.

## Discussion

Discussion The AudioBufferList must contain the same number of channels and its data buffers must be sized to hold the specified number of frames. note: CMSampleBuffer.Error.sampleIndexOutOfRange if the range does not fit in the sample buffer or if the bufferList does not have enough capacity.
