   @getSongs: (callbacks)->
     Kandan.Store.get @pluginId, callbacks
 
-  @nicknameToUrl: (url) ->
+  @localFileUrl: (fileName) ->
+    "http://#{ window.location.hostname }:#{ window.location.port }/sounds/#{ fileName }"
+
+  @localSounds: (name) ->
     sounds = {
-      'claps'  : 'golfclap.mp3',
-      'cheers' : 'cheers.mp3',
-      'ding'   : 'ding.wav',
-      'gong'   : 'gong.mp3'
+      'claps'  : @localFileUrl('golfclap.mp3')
+      'cheers' : @localFileUrl('cheers.mp3')
+      'ding'   : @localFileUrl('ding.wav')
+      'gong'   : @localFileUrl('gong.mp3')
       }
 
-    fullUrl   = null
-    fullUrl   = sounds[url]
-    fullUrl ||= url
+    sounds[name]
 
   @audioChannels: ->
     Kandan.Helpers.Audio.audioChannels()

  @init: (pluginId)->
    @pluginId = pluginId
    Kandan.Data.Channels.registerCallback("change", $.proxy(@onChannelChange, this))
    @registerModifier()
    @registerWidget()


  @registerWidget: ()->
    Kandan.Widgets.register @pluginNamespace


  @registerModifier: ()->
    Kandan.Modifiers.register @playRegex, (message, state) =>
      url = $.trim(message.content.substr(message.content.indexOf(" ") + 1));
      if true and Kandan.Data.Channels.activeChannelId()? # and state == Kandan.Helpers.Activities.ACTIVE_STATE commented out because state == undefined for some reason
        @playUrl(message.channel_id, Kandan.Helpers.Utils.unescape(url))
      else
        console.log "Not playing stale song"

      message.content = @playTemplate({url: url})
      return Kandan.Helpers.Activities.buildFromBaseTemplate message




  @playUrl: (channelId, url) ->
    @setAudioUrl(channelId, url)
    @play(channelId)

  @play: (channelId) ->
    @audioChannel(channelId).play()

  @stopSound: (channelId) ->
    @audioChannel(channelId).pause()

  @currentChannel: () ->
    Kandan.Data.Channels.activeChannelId()
