Platforms to show: All Mac Windows Linux Cross-Platform

Back to SCNAudioPlayerMBS class.

SCNAudioPlayerMBS.audioPlayerWithAVAudioNode(audioNode as Variant) as SCNAudioPlayerMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 22.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns an audio player (creating one if necessary) to play an audio node.

Please pass a AVAudioNodeMBS class.

Creating an audio player from an audio node does not attach that node to an AVAudioEngine object for mixing and playback—instead, this option allows you to build your own audio node graph for custom effects before manually adding it to the audioEngine object of the view (or other SceneKit renderer) displaying the scene. Then, after you attach the audio player to an SCNNodeMBS object, SceneKit continually updates the audio node’s 3D mixing parameters to match the position of the scene node.

When you use this method, SceneKit creates an audio player for the specified AVAudioNodeMBS object or, if an audio player for that node already exists and is not in use, SceneKit reuses the existing player object.

SCNAudioPlayerMBS.audioPlayerWithSource(audioSource as SCNAudioSourceMBS) as SCNAudioPlayerMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 22.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns an audio player (creating one if necessary) to play a simple audio source.

An SCNAudioSourceMBS 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 SCNAudioSourceMBS 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 AVAudioNodeMBS objects and create a player for it with the audioPlayerWithAVAudioNode() method.

The items on this page are in the following plugins: MBS Mac64bit Plugin.


The biggest plugin in space...