src/js/fart.js
/*
 * Makes a network request for each file under the 'sounds' directory.
 * Then decodes the audio data into a buffer and saves it.
 *
 * TODO: Error handling.
 * Need to come up with some graceful crash, or something to that effect.
 */
Makes a network request for each file under the 'sounds' directory.
Then decodes the audio data into a buffer and saves it.

Error handling.
Need to come up with some graceful crash, or something to that effect.
Makes a network request for each file under the ' sounds ' directory . Then decodes the audio data into a buffer and saves it . Error handling . Need to come up with some graceful crash or something to that effect .
function fetchSounds () {
  soundUrls.forEach(function (url) {
    fetch(url)
      .then(function (response) {
        return response.arrayBuffer();
      })
      .then(function (response) {
        return audioContext.decodeAudioData(response, saveAudioBuffer);
      });
  });
}
function fetchSounds ( ) { soundUrls . forEach ( function ( url ) { fetch ( url ) . then ( function ( response ) { return response . arrayBuffer ( ) ; } ) . then ( function ( response ) { return audioContext . decodeAudioData ( response , saveAudioBuffer ) ; } ) ; } ) ; }
Makes a network request for each file under the 'sounds' directory.
Makes a network request for each file under the ' sounds ' directory .