 class Source
   constructor: (@filename, @type) ->
+    @element = document.createElement("audio")
+    @element.setAttribute("src", "lua/" + filename)
+
+    # one would think that you should use preload=none for a stream type asset
+    # except that that doesn't really work for our use-case
+    @element.setAttribute("preload", "auto")
 
   clone: (self) ->
+    new Source(self.filename, self.type)
 
   getAttenuationDistances: (self) ->
 


  setDirection: (self) ->

  setLooping: (self) ->

  setPitch: (self) ->


  getVelocity: (self) ->

  getVolume: (self) ->
    self.element.volume

  getVolumeLimits: (self) ->

  isLooping: (self) ->
    !!self.element.getAttribute("loop")

  isPaused: (self) ->
    self.element.paused

  isPlaying: (self) ->
    !self.element.paused

  isRelative: (self) ->

  isStatic: (self) ->

  isStopped: (self) ->
    self.isPaused(self) and self.currentTime == 0

  pause: (self) ->
    self.element.pause()

  play: (self) ->
    self.element.play()

  resume: (self) ->
    self.element.play()

  rewind: (self) ->
    self.element.currentTime = 0

  seek: (self, offset, time_unit = "seconds") ->
    switch time_unit
      when "seconds" then self.element.currentTime = offset

  setAttenuationDistances: (self) ->

