text: /** Factory that creates sound related objects in application.
   *
   * The back-end is either PLAYGROUND.SoundWebAudioAPI or PLAYGROUND.SoundAudio.
   *
   * The application object will have tow (identical) objects inserted:
   * `sound` and `music`.
   */
  PLAYGROUND.Sound = function(app) {
  
    var audioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext;
  
    if (audioContext && !app.forceAudioFallback) {
  
      if (!PLAYGROUND.audioContext) PLAYGROUND.audioContext = new audioContext;
  
      app.audioContext = PLAYGROUND.audioContext;
      app.sound = new PLAYGROUND.SoundWebAudioAPI(app, app.audioContext);
      app.music = new PLAYGROUND.SoundWebAudioAPI(app, app.audioContext);
  
    } else {
  
      app.sound = new PLAYGROUND.SoundAudio(app);
      app.music = new PLAYGROUND.SoundAudio(app);
  
    }
  
  };
  
  /** Play a sound */
  PLAYGROUND.Application.prototype.playSound = function(key, loop) {
  
    return this.sound.play(key, loop);
  
  };
  
  /** Stop a sound from playing */
  PLAYGROUND.Application.prototype.stopSound = function(sound) {
  
    this.sound.stop(sound);
  
  };
  
  /** Load the sound */
  PLAYGROUND.Application.prototype.loadSound = function() {
  
    return this.loadSounds.apply(this, arguments);
  
  };
  
  /** Load multiple sounds */
  PLAYGROUND.Application.prototype.loadSounds = function() {
  
    for (var i = 0; i < arguments.length; i++) {
  
      var arg = arguments[i];
  
      /* polymorphism at its finest */
  
      if (typeof arg === "object") {
  
        for (var key in arg) this.loadSounds(arg[key]);
  
      } else {
        this.sound.load(arg);
      }
    }
  
  };