From 3608a5947f225c5cdb8f8859e4aa931a2a71821c Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Wed, 22 Mar 2017 18:09:42 -0400 Subject: [PATCH] Decode sounds in audio engine Remove logic for loading sounds, since that is handled by Scratch Storage --- src/index.js | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/index.js b/src/index.js index f841f29..d3c2cb7 100644 --- a/src/index.js +++ b/src/index.js @@ -56,37 +56,37 @@ function AudioEngine () { } /** - * Load all sounds for a sprite and store them in the audioBuffers dictionary, indexed by md5 - * @param {Object} sounds - an array of objects containing metadata for sound files of a sprite + * Decode a sound, decompressing it into audio samples. + * Store a reference to it the sound in the audioBuffers dictionary, indexed by md5 + * @param {Object} sound - an object containing audio data and metadata for a sound */ -AudioEngine.prototype.loadSounds = function (sounds) { +AudioEngine.prototype.decodeSound = function (sound) { + var storedContext = this; - for (var i=0; i