added applyConfig method to BaseSound class and calling it inside of WebAudioSound class play method

This commit is contained in:
Pavle Goloskokovic 2017-11-16 13:32:35 +01:00
parent 928487f7b1
commit 25bd3816c7
2 changed files with 6 additions and 1 deletions

View file

@ -124,6 +124,11 @@ var BaseSound = new Class({
stop: function () {
return this;
},
applyConfig: function () {
this.mute = this.currentConfig.mute;
this.volume = this.currentConfig.volume;
// TODO assign other config values to buffer source
},
fadeTo: function (volume, duration) {
return null;
},

View file

@ -60,9 +60,9 @@ var WebAudioSound = new Class({
}
this.currentConfig = Extend(this.currentConfig, config);
this.source = this.manager.context.createBufferSource();
// TODO assign config values to buffer source
this.source.buffer = this.audioBuffer;
this.source.connect(this.muteNode);
this.applyConfig();
this.source.start();
return this;
}