 
 module.exports = class SoundManager extends Model
 
-  FADE_BACKGROUND_INTERVAL: 1
-
   ###
   Initialize Soundmanager.
   Create a new audio context and bind soundManager to mediator

    sound = request.additionalAttributes[0]
    callback = request.additionalAttributes[1]

    # TODO: use webworkers, some day (http://www.html5rocks.com/en/tutorials/workers/basics/)
    console.time "bufferSounds #{sound}"
    buffer = @audioContext.decodeAudioData request.response, (buffer) =>
      console.timeEnd "bufferSounds #{sound}"

      @globalSoundList[sound].buffer = buffer



  ###
  @param [String]
  @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
