SFXPlayer

platypus. SFXPlayer

new SFXPlayer()

This class plays sfx audio and manages Springroll volume changes.

Source:

Methods

destroy()

Cleans up this SFXPlayer.

Source:

play(sound, data) → {pixiSound.MediaInstance}

Plays a sound.

Source:
Parameters:
Name Type Description
sound String

Sound Id to play.

data Object

PixiSound data to inform sound playback.

Returns:
Type:
pixiSound.MediaInstance

The media instance of the playing sound.

setVolume(volume)

Sets volume on all playing sound effects.

Source:
Parameters:
Name Type Description
volume Number

A value between 0-1 to set volume on all playing sound effects.

stop(audio)

Plays a sound.

Source:
Parameters:
Name Type Description
audio pixiSound.MediaInstance

Audio to stop.