Skip to content

Commit 70a07ed

Browse files
fixed reference issue
added default value for WebAudioSound constructor config
1 parent 82bcaaf commit 70a07ed

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

v3/src/sound/WebAudioSound.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ var WebAudioSound = new Class({
1010
*
1111
* @property {AudioBuffer} audioBuffer
1212
*/
13-
this.audioBuffer = this.manager.game.cache.audio.get(key);
13+
this.audioBuffer = manager.game.cache.audio.get(key);
1414
if (!this.audioBuffer) {
1515
console.error('No audio loaded in cache with key: \'' + key + '\'!');
1616
return;
1717
}
18+
if (config === void 0) {
19+
config = {};
20+
}
1821
config.duration = this.audioBuffer.duration;
1922
BaseSound.call(this, manager, key, config);
2023
},

0 commit comments

Comments
 (0)