<!--
{
  "availability" : [
    "watchOS: 2.0.0 - 6.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKAudioFilePlayer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKAudioFilePlayer"
  },
  "title" : "WKAudioFilePlayer"
}
-->

# WKAudioFilePlayer

An object that controls playback of a single audio item.

```
class WKAudioFilePlayer
```

## Overview

Use a player object to start and stop playback and to control the rate of playback. (The [`WKAudioFileQueuePlayer`](/documentation/WatchKit/WKAudioFileQueuePlayer) subclass extends the basic behavior to support playback of more than one item.)

The value of the player’s presentation-related properties are not valid until the underlying asset is loaded. Use the value of the [`status`](/documentation/WatchKit/WKAudioFilePlayer/status) property to determine when it is valid to get the values of other properties. Specifically, wait until the status changes to [`WKAudioFilePlayerStatus.readyToPlay`](/documentation/WatchKit/WKAudioFilePlayerStatus/readyToPlay) to access relevant properties.

The [`WKAudioFilePlayer`](/documentation/WatchKit/WKAudioFilePlayer) class is key-value observing compliant for the [`currentItem`](/documentation/WatchKit/WKAudioFilePlayer/currentItem), [`status`](/documentation/WatchKit/WKAudioFilePlayer/status), and [`rate`](/documentation/WatchKit/WKAudioFilePlayer/rate) properties. You can use an observer to detect changes to those properties and react accordingly. For information on how to observe properties using key-value observing, see [Key-Value Observing Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html#//apple_ref/doc/uid/10000177i).

## Topics

### Creating a Player

[`init(playerItem:)`](/documentation/WatchKit/WKAudioFilePlayer/init(playerItem:))

Creates and returns a player initialized with the specified player item.

[`replaceCurrentItem(with:)`](/documentation/WatchKit/WKAudioFilePlayer/replaceCurrentItem(with:))

Replaces the current player item with a different one.

### Configuring and Controlling Playback

[`play()`](/documentation/WatchKit/WKAudioFilePlayer/play())

Begins playback of the current item.

[`pause()`](/documentation/WatchKit/WKAudioFilePlayer/pause())

Pauses playback of the associated item.

[`rate`](/documentation/WatchKit/WKAudioFilePlayer/rate)

The current rate of playback.

### Getting Information About the Player

[`currentItem`](/documentation/WatchKit/WKAudioFilePlayer/currentItem)

The player’s current item.

[`status`](/documentation/WatchKit/WKAudioFilePlayer/status)

The status of the player.

[`error`](/documentation/WatchKit/WKAudioFilePlayer/error)

An error that describes the cause of a failure.

### Getting Timing Information

[`currentTime`](/documentation/WatchKit/WKAudioFilePlayer/currentTime)

The elapsed time for the current playing item.

### Constants

[`WKAudioFilePlayerStatus`](/documentation/WatchKit/WKAudioFilePlayerStatus)

Constants that represent the status of the player.



---

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)