How Can I Create Spatial Audio in iOS with Swift?

Viewed 829

I'm trying to get spatial audio working using Dolby Atmos media files.

Question: Do I need to use SceneKit, RealityKit and or CoreMotion with CMHeadphoneMotionManager to build this functionality or does it come out of the box by setting allowedAudioSpatializationFormats simply with AVPlayer?

More Info: App I'm trying to build is a spatial music app, not a game or something using 3D objects.

The apple documentation is unclear as to how to actually achieve this.

For an example, use AirPods Pro with custom iOS app to hear the spatial audio ie. "Music" with instruments surrounding the listener.

Thanks!

2 Answers

I am going to make a little deduction because I haven't researched a lot yet, but according to the documentation you can choose the audio type. My deduction (you noted "use AirPods Pro with Apple TV to hear the spatial audio") is that it's hardware related. However:

If the device doesn’t support spatial audio, it falls back to mono.

Related