---
title: "outputProviderWithRandomAccess(for:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avassetreader/outputproviderwithrandomaccess(for:)"
---

# outputProviderWithRandomAccess(for:)

Attaches the output to the reader and returns a tuple with an output provider for reading sample buffers, and an associated random access controller.

## Declaration

```swift
func outputProviderWithRandomAccess(for output: AVAssetReaderOutput) -> sending (AVAssetReaderOutput.Provider<CMReadySampleBuffer<CMSampleBuffer.DynamicContent>>, AVAssetReaderOutput.RandomAccessController)
```

## Parameters

- `output`: The output to be attached to the reader.

## Return Value

Return Value A tuple with an output provider for reading sample buffers, and an associated random access controller.

## See Also

### Accessing output providers

- [outputProvider(for:)](avfoundation/avassetreader/outputprovider(for:).md)
- [outputCaptionProvider(for:validationDelegate:)](avfoundation/avassetreader/outputcaptionprovider(for:validationdelegate:).md)
- [outputCaptionProviderWithRandomAccess(for:validationDelegate:)](avfoundation/avassetreader/outputcaptionproviderwithrandomaccess(for:validationdelegate:).md)
- [outputMetadataProvider(for:)](avfoundation/avassetreader/outputmetadataprovider(for:).md)
- [outputMetadataProviderWithRandomAccess(for:)](avfoundation/avassetreader/outputmetadataproviderwithrandomaccess(for:).md)
