Class

SCNAudioSource

A simple, reusable audio source—music or sound effects loaded from a file—for use in positional audio playback.

Declaration

@interface SCNAudioSource : NSObject

Overview

To create positional audio effects, create an SCNAudioPlayer object from the audio source to control playback, and add that player object to an SCNNode object in your scene. SceneKit then automatically spatializes 3D audio effects based on the position of that node relative to the scene’s audioListener node.

Topics

Creating an Audio Source

+ audioSourceNamed:

Returns the audio source associated with the specified filename.

- initWithFileNamed:

Initializes an audio source from an audio file in the application’s main bundle.

- initWithURL:

Initializes an audio source from the specified audio file.

Controlling 3D Audio Spatialization

positional

A Boolean value that determines whether audio from this source uses 3D positional mixing.

Preloading Audio Data

- load

Loads audio data from the source and prepares it for playing.

Setting Default Playback Parameters

volume

The default playback volume for the audio source.

rate

The default playback rate for the audio source.

reverbBlend

The default blend of blend of unmodified and reverb-processed (also called dry and wet) audio for playback of the audio source.

loops

A Boolean value that determines whether the audio source should play repeatedly.

shouldStream

A Boolean value that determines whether the audio source should stream content from its source URL when playing.

Relationships

Inherits From

See Also

Audio

SCNAudioPlayer

A controller for playback of a positional audio source in a SceneKit scene.