<!--
{
  "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/init(audioDataBuffer:formatDescription:sampleCount:presentationTimeStamp:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Media",
      "CoreMedia"
    ],
    "preciseIdentifier" : "s:9CoreMedia19CMReadySampleBufferVA2A019CMReadOnlyDataBlockE0VRszrlE05audiohE017formatDescription11sampleCount21presentationTimeStampACyAEGAE_So08CMFormatL3RefaSiSo6CMTimeatcfc"
  },
  "title" : "init(audioDataBuffer:formatDescription:sampleCount:presentationTimeStamp:)"
}
-->

# init(audioDataBuffer:formatDescription:sampleCount:presentationTimeStamp:)

Creates a sample buffer carrying audio media data.

```
init(audioDataBuffer content: Content, formatDescription: CMAudioFormatDescription, sampleCount: Int, presentationTimeStamp: CMTime)
```

## Parameters

`formatDescription`

Format description of the content. The format must have audio media type.

`sampleCount`

Number of samples in the content. Must be greater than 0.

`presentationTimeStamp`

The time at which the first sample will be presented. Must be valid numeric time.

## Discussion

Use this init when the audio format is a linear PCM format or a constant bit rate (CBR) format. The
`AudioStreamBasicDescription` in the format is used along with `sampleCount` & `presentationTimeStamp` to calculate
the sample size & timings. The `AudioStreamBasicDescription/mBytesPerPacket` in the format description must be
0 for this init to consider it as a valid format. Otherwise,
`init(compressedAudioDataBuffer:formatDescription:presentationTime:packetDescriptions:)` must be used along
with a valid packet description array.

---

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)