<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNAudioPlayer/audioPlayerWithSource:",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNAudioPlayer(cm)audioPlayerWithSource:"
  },
  "title" : "audioPlayerWithSource:"
}
-->

# audioPlayerWithSource:

Returns an audio player (creating one if necessary) to play a simple audio source.

```
+ (instancetype) audioPlayerWithSource:(SCNAudioSource *) source;
```

## Parameters

`source`

An audio source object.

## Return Value

A positional audio player object.

## Discussion

An [`SCNAudioSource`](/documentation/SceneKit/SCNAudioSource) 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 [`SCNAudioSource`](/documentation/SceneKit/SCNAudioSource) 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 <doc://com.apple.documentation/documentation/AVFAudio/AVAudioNode> objects and create a player for it with the [`audioPlayerWithAVAudioNode:`](/documentation/SceneKit/SCNAudioPlayer/audioPlayerWithAVAudioNode:) method.

---

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)