Phaser API Documentation

  Version: 
Event: VOLUME
Phaser.Sound.Events.VOLUME
VOLUME

Description:

The Sound Volume Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes.

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

var music = this.sound.add('key');
music.on('volume', listener);
music.play();
music.setVolume(0.5);

Parameters:

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

A reference to the Sound that emitted the event.

volume number

The new volume of the Sound.

Since: 3.0.0