<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKAudioNode",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAudioNode"
  },
  "title" : "SKAudioNode"
}
-->

# SKAudioNode

A node that plays audio.

```
class SKAudioNode
```

## Overview

A [`SKAudioNode`](/documentation/SpriteKit/SKAudioNode) object is used to add an audio to a scene. The sounds are played automatically using AVFoundation, and the node can optionally add 3D spatial audio effects to the audio when it is played.

The currently presented [`SKScene`](/documentation/SpriteKit/SKScene) object mixes the audio from nodes in the scene based on parameters defined in the <doc://com.apple.documentation/documentation/AVFAudio/AVAudio3DMixing> protocol. A scene’s [`audioEngine`](/documentation/SpriteKit/SKScene/audioEngine) property allows overall control of volume and playback.

By default, [`SKAudioNode`](/documentation/SpriteKit/SKAudioNode) objects are positional, i.e. their [`isPositional`](/documentation/SpriteKit/SKAudioNode/isPositional) property is set to <doc://com.apple.documentation/documentation/Swift/true>. If you add an audio node to a scene with a [`listener`](/documentation/SpriteKit/SKScene/listener) set, SpriteKit will set the stereo balance and the volume based on the relative positions of the two nodes.

You can explicitly set the volume or stereo balance to an audio node by running actions on it.

SpriteKit includes actions that reduce an audio node’s volume by changing either its occlusion or obstruction. The difference between these actions is that occlusion affects both the direct and reverb paths of the sound while obstruction only affects the direct path. The *change volume* action offers absolute control over an audio node’s volume.

You can manually set the stereo balance of an audio node with a *stereo pan* action.

Special effects, such as speeding up or slowing down audio by changing the playback rate and adding reverb are also available as audio actions.

To learn more about audio actions, see Controlling the Audio of a Node in [Action Initializers](/documentation/SpriteKit/action-initializers).

## Topics

### First Steps

[Using Audio Nodes with the Scene’s Listener](/documentation/SpriteKit/using-audio-nodes-with-the-scene-s-listener)

Add audio to your scene, and optionally give it 2D-positional mixing characteristics.

### Initializing Audio Nodes

[`init(avAudioNode:)`](/documentation/SpriteKit/SKAudioNode/init(avAudioNode:)-969st)

Initializes an audio node from an AVFoundation audio node.

[`init(fileNamed:)`](/documentation/SpriteKit/SKAudioNode/init(fileNamed:))

Initializes an audio node from an audio asset with the specified filename.

[`init(url:)`](/documentation/SpriteKit/SKAudioNode/init(url:)-8v3q0)

Initializes an audio node from an audio asset with the specified URL.

[`init(coder:)`](/documentation/SpriteKit/SKAudioNode/init(coder:))

Tells you when to initialize an audio node that has been unarchived.

### Configuring Audio Nodes

[`avAudioNode`](/documentation/SpriteKit/SKAudioNode/avAudioNode)

The audio node’s current audio asset.

[`isPositional`](/documentation/SpriteKit/SKAudioNode/isPositional)

A Boolean property that indicates whether the node’s audio is altered based on the position of the node.

[`autoplayLooped`](/documentation/SpriteKit/SKAudioNode/autoplayLooped)

A Boolean value that indicates whether the audio should play in a loop when the node is added to the scene.



---

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)