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