---
title: "CMSampleBufferGetTotalSampleSize(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmsamplebuffergettotalsamplesize(_:)"
---

# CMSampleBufferGetTotalSampleSize(_:)

Returns the total size in bytes of sample data in a sample buffer.

## Declaration

```swift
func CMSampleBufferGetTotalSampleSize(_ sbuf: CMSampleBuffer) -> Int
```

## Parameters

- `sbuf`: The CMSampleBuffer being interrogated.

## Return Value

Return Value Total size in bytes of sample data in the CMSampleBuffer. If there are no sample sizes in this CMSampleBuffer, a size of 0 will be returned.

## See Also

### Inspecting Size Information

- [CMSampleBufferGetNumSamples(_:)](coremedia/cmsamplebuffergetnumsamples(_:).md)
- [CMSampleBufferGetSampleSize(_:at:)](coremedia/cmsamplebuffergetsamplesize(_:at:).md)
- [CMSampleBufferGetSampleSizeArray(_:entryCount:arrayToFill:entriesNeededOut:)](coremedia/cmsamplebuffergetsamplesizearray(_:entrycount:arraytofill:entriesneededout:).md)
