AppleSCNAudioPlayer - UBogun/Xojo-iosLib GitHub Wiki

Inherits from AppleObject
Memory leak check: not yet done.
Status: complete.

An SCNAudioPlayer object controls playback of a positional audio source in a SceneKit scene. To use positional audio, first create a reusable SCNAudioSource or AVAudioNode object to provide an audio stream. Then, create an audio player to control the playback of that audio source. Finally, attach the audio player to an SCNNode object for spatialized 3D audio playback based on the position of that node relative to the scene’s audioListener node.

This class is available in iOS 9.0 or later. Check the ClassAvailable shared poperty to enquire its availability before using!

Constructors

Constructor (Node As AppleAVAudioNode): Initializes an audio player for playing the specified AVFoundation audio node.

Constructor (Source As AppleSCNAudioSource): Initializes an audio source from the specified audio file.

##Properties AudioSource As AppleSCNAudioSource: The source of audio played by this player. (read-only)

AudioNodee As AppleAVAudioNode: The audio node SceneKit uses for mixing audio from this player. (read-only)

Events

Finished(): Fires when the Player finished playback.

WillPlay(): Fires when the Player is about to begin playback.

Please note that you can use your own block for both events when you tweak the private AddBlocks method or make the setDidFinishPlayBack and setWillStartPlayback external methods computed properties too.