function Sound(opt_loop) {

  var self_ = this;
  var context_ = null;
  var source_ = null;
  var loop_ = opt_loop || false;

  // Get the context
  window.AudioContext = window.AudioContext || window.webkitAudioContext;
  if (window.AudioContext) {
    context_ = new window.AudioContext();
  }

  /**
   * Loads in a sound file using XHR.
   *
   * @param {String} url The URL to load
   * @param {Boolean} mixToMono If the sound should be mixed down to mono
   * @param {Function} opt_callback A function to call when the file has loaded
   */
  this.load = function(url, mixToMono, opt_callback) {
    if (context_) {
      var xhr = new XMLHttpRequest();
      xhr.open('GET', url, true);
      xhr.responseType = 'arraybuffer';
      xhr.onload = function() {
        context_.decodeAudioData(this.response, function(audioBuffer) {
          self_.sample = audioBuffer;
          opt_callback && opt_callback();
        }, function(e) {
          console.log(e);
        });
      };
      xhr.send();
    }
  };

  /**
   * Plays the sound
   */
  this.play = function() {
    if (context_) {
      source_ = context_.createBufferSource();
      source_.buffer = self_.sample;
      source_.looping = loop_;
      source_.connect(context_.destination);
      source_.noteOn(0);
    }
  };

  /**
   * Stops the sound
   */
  this.stop = function() {
    if (source_) {
      source_.noteOff(0);
      source_.disconnect(0);
    }
  };
}
Creates a audio context to play sounds