Contents

listener

A node used to determine the position of the listener for positional audio in the scene.

Declaration

weak var listener: SKNode? { get set }

Mentioned in

Discussion

The default value is nil, which means that the scene’s origin is used as the listener position for audio effects played by SKAudioNode objects in the scene. If a non-nil value is specified, it must be a node in the scene.

Typically, you want the camera to be the listener so that audio nodes which are on screen are louder than off screen ones. In a game, the node that defines the player would likely be set as the listener.

See Also

Adding Positional Audio