Skip to content

Commit 7d33534

Browse files
passing audio context to AudioFile constructor instead of sound manager
1 parent 3a14d66 commit 7d33534

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

v3/src/loader/filetypes/AudioFile.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ var AudioFile = new Class({
1111

1212
initialize:
1313

14-
function AudioFile (key, url, path, xhrSettings, soundManager)
14+
function AudioFile (key, url, path, xhrSettings, audioContext)
1515
{
16-
17-
this.soundManager = soundManager;
16+
this.context = audioContext;
1817

1918
var fileConfig = {
2019
type: 'audio',
@@ -36,7 +35,7 @@ var AudioFile = new Class({
3635
var _this = this;
3736

3837
// interesting read https://github.com/WebAudio/web-audio-api/issues/1305
39-
this.soundManager.context.decodeAudioData(this.xhrLoader.response,
38+
this.context.decodeAudioData(this.xhrLoader.response,
4039
function (audioBuffer)
4140
{
4241
_this.data = audioBuffer;
@@ -83,7 +82,7 @@ AudioFile.create = function (loader, key, urls, config, xhrSettings)
8382

8483
if(deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))
8584
{
86-
loader.addFile(new AudioFile(key, url, loader.path, xhrSettings, game.sound));
85+
loader.addFile(new AudioFile(key, url, loader.path, xhrSettings, game.sound.context));
8786
return;
8887
}
8988

0 commit comments

Comments
 (0)