SpatialAudioExperience
Configure an audio stream for spatial computing.
Declaration
protocol SpatialAudioExperience : Decodable, Encodable, Hashable, SendableMentioned in
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()