From 6c538d06593841eea224dc080e5983cd9101fdd6 Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Wed, 11 Apr 2018 10:28:22 -0400 Subject: [PATCH] Sounds should still get loaded from storage even if there is not an audio engine present. This is analagous to costumes getting loaded even if there is no renderer present. --- src/import/load-sound.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/import/load-sound.js b/src/import/load-sound.js index e4c7009b9..c14e5276d 100644 --- a/src/import/load-sound.js +++ b/src/import/load-sound.js @@ -12,6 +12,10 @@ const log = require('../util/log'); */ const loadSoundFromAsset = function (sound, soundAsset, runtime) { sound.assetId = soundAsset.assetId; + if (!runtime.audioEngine) { + log.error('No audio engine present; cannot load sound asset: ', sound.md5); + return Promise.resolve(sound); + } return runtime.audioEngine.decodeSound(Object.assign( {}, sound, @@ -35,10 +39,6 @@ const loadSound = function (sound, runtime) { log.error('No storage module present; cannot load sound asset: ', sound.md5); return Promise.resolve(sound); } - if (!runtime.audioEngine) { - log.error('No audio engine present; cannot load sound asset: ', sound.md5); - return Promise.resolve(sound); - } const idParts = StringUtil.splitFirst(sound.md5, '.'); const md5 = idParts[0]; const ext = idParts[1].toLowerCase();