<!--
{
  "availability" : [
    "ProVideo Encoder Extensions: 1.0.0 -",
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Professional Video Applications",
  "identifier" : "/documentation/professional_video_applications/CompressorMediaDecoder/copyAudio(atStart:count:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Professional Video Applications"
    ],
    "preciseIdentifier" : "c:objc(pl)CompressorMediaDecoder(im)copyAudioAtStart:count:"
  },
  "title" : "copyAudio(atStart:count:)"
}
-->

# copyAudio(atStart:count:)

Returns decoded audio samples starting from the specified temporal position.

```
func copyAudio(atStart start: Int64, count: UnsafeMutablePointer<Int64>!) -> Data!
```

## Parameters

`start`

The temporal position of the audio sample.

`count`

On input, the number of audio samples to return; on output, the actual number of samples returned.

## Return Value

A data buffer with decoded audio samples at the sample rate and channel layout specified in the encoder settings.

## Discussion

If the decoder does not have enough samples to return as specified in the `count` parameter, it updates the `count` parameter with the actual number of samples in the returned audio data buffer.

> Note:
> It’s recommended that you call the decoder for audio samples of 1 second per call, in temporal order.

---

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)