---
title: "init(byteSource:sampleLocation:)"
framework: MediaExtension
role: symbol
role_heading: Initializer
platforms: [macOS 14.0+]
path: "mediaextension/mesamplelocation/init(bytesource:samplelocation:)"
---

# init(byteSource:sampleLocation:)

Creates a sample location object with the byte source and sample location that you specify.

## Declaration

```swift
init(byteSource: MEByteSource, sampleLocation: AVSampleCursorStorageRange)
```

## Parameters

- `byteSource`: The byte source to use to read the data for the sample.
- `sampleLocation`: The starting file offset and size in bytes of the sample.
