Defining detune property in BaseSound class so it can be used in both Web Audio and HTML5 Audio implementations

This commit is contained in:
Pavle Goloskokovic 2017-11-27 17:35:35 +01:00
parent 1c1e75ac85
commit 28ae0811e6

View file

@ -126,4 +126,19 @@ Object.defineProperty(BaseSoundManager.prototype, 'rate', {
}, this);
}
});
/**
* Global detune.
* @property {number} detune
*/
Object.defineProperty(BaseSoundManager.prototype, 'detune', {
get: function () {
return this._detune;
},
set: function (value) {
this._detune = value;
this.sounds.forEach(function (sound) {
sound.setRate();
}, this);
}
});
module.exports = BaseSoundManager;