<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioPlayerNode/scheduleBuffer(_:atTime:options:completionCallbackType:completionHandler:)-3ewd3",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "s:So17AVAudioPlayerNodeC8AVFAudioE14scheduleBuffer_6atTime7options22completionCallbackType0J7HandlerySo0A9PCMBufferC_So0aH0CSgSo0abcF7OptionsVSo0abc10CompletionkL0VyyYbcSgtF"
  },
  "title" : "scheduleBuffer(_:atTime:options:completionCallbackType:completionHandler:)"
}
-->

# scheduleBuffer(_:atTime:options:completionCallbackType:completionHandler:)

Schedules playing samples from an audio buffer.

```
func scheduleBuffer(_ buffer: AVAudioPCMBuffer, atTime when: AVAudioTime? = nil, options: AVAudioPlayerNodeBufferOptions = [], completionCallbackType callbackType: AVAudioPlayerNodeCompletionCallbackType, completionHandler: (@Sendable () -> Void)?)
```

## Parameters

`buffer`

The buffer to play.

`when`

The time at which to play the buffer. Nil means “follow previous command”.

`options`

Options for looping, interrupting, etc.

`callbackType`

Specifies when the completion handler is called.

`completionHandler`

Called after the buffer has been consumed, rendered,
or played back. May be nil.

---

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)