Closed aquisenberry closed 8 years ago
In sound-loader.js:
SoundLoader.prototype.setVolume = function(gain) { this.volume = gain; this.gainNode.gain = gain; this.muted = false; };
this.gainNode.gain = gain; is throwing the following error when calling game.sounds.setVolume(num):
Cannot set property gain of # which has only a getter
Looking at how the rest of the code uses gainNode, it's probably just missing the .value: this.gainNode.gain.value = this.volume;
gainNode
.value
this.gainNode.gain.value = this.volume;
Can you try this, and if it works, send a PR? Thanks!
Fixed with PR#40
In sound-loader.js:
this.gainNode.gain = gain; is throwing the following error when calling game.sounds.setVolume(num):