     return soundMap
 
 
+  ###
+  @param [Array]
+  @param [function]
+  Load sounds
+  ###
   loadSounds: (mapSounds, callback) =>
     @soundCount = mapSounds.sounds.length + mapSounds.backgroundSounds.length + 1
 


  ###
  @param [String]
  @param [Object]
  @param [Double]
  @param [Bool]
  Play sound of list with volume and loop
  ###
  playSound: (sound, volume, loops) =>
    if @globalSoundList[sound].isPlaying != true
      sourceNode = @audioContext.createBufferSource()
      sourceNode.buffer = @globalSoundList[sound].buffer
      sourceNode.loop = loops

      sourceNode.gain.value = volume
      sourceNode.connect(@audioContext.destination)

      @globalSoundList[sound].sourceNode = sourceNode

    lvl = mediator.getActiveLevel()
    for sound in lvl.soundMap[Math.floor(PlayerPosition.x/32)][Math.floor(PlayerPosition.y/32)]
      # sound.type is the name of the sound here
      @fade sound.type+'.mp3', sound.intensity/100, 1
      @backgroundSoundsToPlay.push(sound.type+'.mp3')

    for sound in lvl.backgroundSoundList
      if @backgroundSoundsToPlay.indexOf(sound) == -1
        @fade sound, 0, 1


  ###
  @param [String]
  @param [Double]
  @param [Double]
  Fade sound to volume
  ###
  fade: (sound, volume, interval) =>
    # exponentially approaching the target value <volume> at the given time with a rate <interval>
