---
title: nextAvailableSampleBuffer()
framework: avfoundation
role: symbol
role_heading: Instance Method
path: avfoundation/avplayeritemsamplebufferoutput/nextavailablesamplebuffer()
---

# nextAvailableSampleBuffer()

Returns the next sample buffer if it is already available.

## Declaration

```swift
func nextAvailableSampleBuffer() -> AVPlayerItemSampleBufferOutput.SampleBufferInSequence?
```

## Discussion

Discussion If no sample buffers are ready, this method will return nil immediately. This method will race with nextSampleBuffer() for grabbing the generated sample buffer.

## See Also

### Retrieving sample buffers

- [nextSampleBuffer()](avfoundation/avplayeritemsamplebufferoutput/nextsamplebuffer().md)
- [AVPlayerItemSampleBufferOutput.SampleBufferInSequence](avfoundation/avplayeritemsamplebufferoutput/samplebufferinsequence.md)
