Returns an audio player (creating one if necessary) to play a simple audio source.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
An audio source object.
A positional audio player object.
SCNAudio object represents a distinct source of audio (for example, a sound file) that can be reused and shared by many player objects. Use this method to create an audio player from such a source. When you use this method, SceneKit creates an audio player for the specified
SCNAudio object or, if an audio player for that source already exists and is not in use, SceneKit reuses the existing player object.
If instead you want to attach a more complex audio setup to a position in your scene—such as a mixer that varies several audio inputs in response to user input—build that setup using
AVAudio objects and create a player for it with the