Type Method

playAudioSource:waitForCompletion:

Creates an action that plays an audio source.

Declaration

+ (SCNAction *)playAudioSource:(SCNAudioSource *)source waitForCompletion:(BOOL)wait;

Parameters

source

The audio source to play.

wait

If YES, the duration of this action is the same as the length of the audio playback. If NO, the action is considered to have completed immediately.

Return Value

A new action object.

Discussion

When the action executes, SceneKit plays the audio source on the target node—any positional audio effects are based on the node’s position. For more information about positional audio in SceneKit, see SCNAudioPlayer.

This action is not reversible; the reverse of this action is the same action.