<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMSampleBuffer/singleSampleBuffers()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Media",
      "CoreMedia"
    ],
    "preciseIdentifier" : "s:So17CMSampleBufferRefa9CoreMediaE19singleSampleBuffersAbCE06SinglegH0VyKF"
  },
  "title" : "singleSampleBuffers()"
}
-->

# singleSampleBuffers()

Returns all samples in a sample buffer.

```
func singleSampleBuffers() throws -> CMSampleBuffer.SingleSampleBuffers
```

## Return Value

All samples from the buffer.

## Discussion

The system creates temporary sample buffers for individual samples that refer to the sample data and containing its timing, size, and attachments.

If there are no sample sizes in the provided sample buffer, the system throws a [`kCMSampleBufferError_CannotSubdivide`](/documentation/CoreMedia/kCMSampleBufferError_CannotSubdivide) error. This happens, for example, if the samples in the buffer are noncontiguous, such as noninterleaved audio.

---

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)