<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMSampleBufferCopyPCMDataIntoAudioBufferList(_:at:frameCount:into:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMSampleBufferCopyPCMDataIntoAudioBufferList"
  },
  "title" : "CMSampleBufferCopyPCMDataIntoAudioBufferList(_:at:frameCount:into:)"
}
-->

# CMSampleBufferCopyPCMDataIntoAudioBufferList(_:at:frameCount:into:)

Copies PCM audio data from a sample buffer into an audio buffer list.

```
func CMSampleBufferCopyPCMDataIntoAudioBufferList(_ sbuf: CMSampleBuffer, at frameOffset: Int32, frameCount numFrames: Int32, into bufferList: UnsafeMutablePointer<AudioBufferList>) -> OSStatus
```

## Parameters

`sbuf`

The sample buffer containing the PCM audio data to be copied.

`frameOffset`

The frame offset number from which to begin the copy.

`numFrames`

The total number of frames to copy.

`bufferList`

The audio buffer list to populate.

## Discussion

The <doc://com.apple.documentation/documentation/CoreAudioTypes/AudioBufferList> must contain the same number of channels and its data buffers must be sized to hold the specified number of frames.

This API is specific to audio format sample buffers, and will return `kCMSampleBufferError_InvalidMediaTypeForOperation` if called with a non-audio sample buffer. It will return an error if the sample buffer doesn’t contain PCM audio data or if its data buffer isn’t ready.

---

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)