volume state handled in vm sound blocks

This commit is contained in:
Eric Rosenbaum 2017-01-31 18:35:37 -05:00
parent b70607d659
commit 08a81af9e5

View file

@ -221,16 +221,7 @@ AudioPlayer.prototype.clearEffects = function () {
};
AudioPlayer.prototype.setVolume = function (value) {
this.currentVolume = this._clamp(value, 0, 100);
this.effectsNode.gain.value = this.currentVolume / 100;
};
AudioPlayer.prototype.changeVolume = function (value) {
this.setVolume(this.currentVolume + value);
};
AudioPlayer.prototype._clamp = function (input, min, max) {
return Math.min(Math.max(input, min), max);
this.effectsNode.gain.value = value / 100;
};
module.exports = AudioEngine;