From 1ec11659054956cbcefaccbb00af3f21e7dd95e1 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Wed, 22 Mar 2017 18:12:04 -0400 Subject: [PATCH] Audio engine decodes sounds --- src/import/sb2import.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/import/sb2import.js b/src/import/sb2import.js index 131c8f3ce..64c1ca9b5 100644 --- a/src/import/sb2import.js +++ b/src/import/sb2import.js @@ -226,11 +226,15 @@ var loadSound = function (sound, runtime) { log.error('No storage module present; cannot load sound asset: ', sound.md5); return; } + if (!runtime.audioEngine) { + log('No audio engine present; cannot load sound asset: ', sound.md5); + return; + } var idParts = sound.md5.split('.'); var md5 = idParts[0]; runtime.storage.load(AssetType.Sound, md5).then(function (soundAsset) { sound.data = soundAsset.data; - // @todo register sound.data with scratch-audio + runtime.audioEngine.decodeSound(sound); }); };