---
title: SpatialAudioExperience
framework: audiotoolbox
role: symbol
role_heading: Protocol
path: audiotoolbox/spatialaudioexperience
---

# SpatialAudioExperience

Configure an audio stream for spatial computing.

## Declaration

```swift
protocol SpatialAudioExperience : Decodable, Encodable, Hashable, Sendable
```

## Mentioned in

Anchoring sound to a window or volume

## Overview

Overview All audio playback APIs support 3D spatial rendering using SpatialAudioExperience. For example, with AVAudioPlayer: // Create a player. let myPlayer = try AVAudioPlayer(contentsOf: myAudioFileURL)

// Configure an audio player with a head-tracked spatial audio experience // so that it's audible from a distinct location in space. myPlayer.intendedSpatialExperience = .headTracked

// Play sound with the configured spatial audio experience. player.play() note: SpatialAudioExperiences.AnchoringStrategy SpatialAudioExperiences.SoundStageSize

## Topics

### Type Properties

- [automatic](audiotoolbox/spatialaudioexperience/automatic.md)
- [bypassed](audiotoolbox/spatialaudioexperience/bypassed.md)
- [fixed](audiotoolbox/spatialaudioexperience/fixed.md)
- [headTracked](audiotoolbox/spatialaudioexperience/headtracked.md)

### Type Methods

- [fixed(soundStageSize:)](audiotoolbox/spatialaudioexperience/fixed(soundstagesize:).md)
- [headTracked(_:soundStageSize:)](audiotoolbox/spatialaudioexperience/headtracked(_:soundstagesize:).md)

## Relationships

### Inherits From

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

### Conforming Types

- [AutomaticSpatialAudio](audiotoolbox/automaticspatialaudio.md)
- [BypassedSpatialAudio](audiotoolbox/bypassedspatialaudio.md)
- [FixedSpatialAudio](audiotoolbox/fixedspatialaudio.md)
- [HeadTrackedSpatialAudio](audiotoolbox/headtrackedspatialaudio.md)
