<!--
{
  "availability" : [
    "iOS: 8.0.0 - 27.0.0",
    "iPadOS: 8.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.10.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 2.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioPlayerNode/play(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioPlayerNode(im)playAtTime:"
  },
  "title" : "play(at:)"
}
-->

# play(at:)

Starts or resumes playback at a time you specify.

```
func play(at when: AVAudioTime?)
```

## Parameters

`when`

The node time to start or resume playback. Passing `nil` starts playback immediately.

## Discussion

This node is initially in a paused state. The framework enqueues your requests to play buffers or file segments, and any necessary decoding begins immediately. Playback doesn’t begin until the player starts playing through this method.

The following example code shows how to start a player `0.5` seconds in the future:

```objc
// Start the engine and player.
NSError *nsErr = nil;
[_engine startAndReturnError:&nsErr];
if (!nsErr) {
    const float kStartDelayTime = 0.5; // sec
    AVAudioFormat *outputFormat = [_player outputFormatForBus:0];
    AVAudioFramePosition startSampleTime = _player.lastRenderTime.sampleTime + kStartDelayTime * outputFormat.sampleRate;
    AVAudioTime *startTime = [AVAudioTime timeWithSampleTime:startSampleTime atRate:outputFormat.sampleRate];
    [_player playAtTime:startTime];
}
```

---

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)