Phaser API Documentation



The Sound Loop Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed.

Listen to it from a Sound instance using Sound.on('loop', listener), i.e.:

var music = this.sound.add('key');
music.on('loop', listener);

This is not to be confused with the LOOPED event, which emits each time a Sound loops during playback.


name type description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

loop boolean

The new loop value. true if the Sound will loop, otherwise false.

Since: 3.0.0