Phaser API Documentation

  Version: 
play([markerName], [config])

Description:

Play this sound, or a marked section of it. It always plays the sound from the start. If you want to start playback from a specific time you can set 'seek' setting of the config object, provided to this call, to that value.

Parameters:

name type arguments Default description
markerName string | Phaser.Types.Sound.SoundConfig <optional> ''

If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object.

config Phaser.Types.Sound.SoundConfig <optional>

Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound.

Returns:
Description:

Whether the sound started playing successfully.

Type:
  • boolean
Since: 3.0.0
Source: src/sound/BaseSound.js (Line 285)