Skip to content

Commit 0c70ae2

Browse files
Dispatching event when sound mute value changes
1 parent c8a0591 commit 0c70ae2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var Class = require('../../utils/Class');
22
var BaseSound = require('../BaseSound');
33
var SoundEvent = require('../SoundEvent');
4+
var SoundValueEvent = require('../SoundValueEvent');
45
// Phaser.Sound.WebAudioSound
56
// TODO support webkitAudioContext implementation differences
67
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext
@@ -334,6 +335,7 @@ Object.defineProperty(WebAudioSound.prototype, 'mute', {
334335
set: function (value) {
335336
this.currentConfig.mute = value;
336337
this.muteNode.gain.setValueAtTime(value ? 0 : 1, 0);
338+
this.events.dispatch(new SoundValueEvent(this, 'SOUND_MUTE', value));
337339
}
338340
});
339341
/**

0 commit comments

Comments
 (0)