Contents

changeVolume(to:duration:)

Creates an action that changes an audio node’s volume to a new value.

Declaration

class func changeVolume(to v: Float, duration: TimeInterval) -> SKAction

Parameters

  • v:

    The new value for the volume. The value should be between 0.0 (silence) and 1.0 (maximum value for source audio), inclusive.

  • duration:

    The duration of the animation, in seconds.

Return Value

A new action object.

Discussion

When the action executes, the audio node’s volume animates from its current value to its new value. For more information, see AVAudio3DMixing.

This action is not reversible.

See Also

Controlling the Audio of a Node