Skip to content

Commit 6811ba5

Browse files
defined mute property on WebAudioSoundManager prototype
1 parent 7a3b288 commit 6811ba5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

v3/src/sound/WebAudioSoundManager.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,16 @@ Object.defineProperty(WebAudioSoundManager.prototype, 'volume', {
5858
this.masterVolumeNode.gain.value = value;
5959
}
6060
});
61+
/**
62+
* Global mute setting.
63+
* @property {boolean} mute
64+
*/
65+
Object.defineProperty(WebAudioSoundManager.prototype, 'mute', {
66+
get: function () {
67+
return this.masterMuteNode.gain.value === 0;
68+
},
69+
set: function (value) {
70+
this.masterMuteNode.gain.value = value ? 0 : 1;
71+
}
72+
});
6173
module.exports = WebAudioSoundManager;

0 commit comments

Comments
 (0)