This commit is contained in:
Richard Davey 2018-01-31 13:54:48 +00:00
commit 65e5b14276
3 changed files with 3 additions and 4 deletions

View file

@ -82,6 +82,8 @@ var AudioFile = new Class({
callback(_this); callback(_this);
} }
); );
this.context = null;
} }
}); });

View file

@ -96,7 +96,6 @@ var BaseSoundManager = new Class({
this.onFocus(); this.onFocus();
} }
}, this); }, this);
game.events.once('destroy', this.destroy, this); game.events.once('destroy', this.destroy, this);
/** /**
@ -412,15 +411,12 @@ var BaseSoundManager = new Class({
destroy: function () destroy: function ()
{ {
this.removeAllListeners(); this.removeAllListeners();
this.forEachActiveSound(function (sound) this.forEachActiveSound(function (sound)
{ {
sound.destroy(); sound.destroy();
}); });
this.sounds.length = 0; this.sounds.length = 0;
this.sounds = null; this.sounds = null;
this.game = null; this.game = null;
}, },

View file

@ -71,6 +71,7 @@ var WebAudioSoundManager = new Class({
var audioConfig = game.config.audio; var audioConfig = game.config.audio;
if (audioConfig && audioConfig.context) if (audioConfig && audioConfig.context)
{ {
audioConfig.context.resume();
return audioConfig.context; return audioConfig.context;
} }
return new AudioContext(); return new AudioContext();