require "tinyandbig"
require "luascape.audio"

sound = {}
sound.nodes = {}

function sound.createSound(filename)
  local sound = Sound.loadFromFile(filename, true)
  return sound
end

function sound.createSoundAt(filename, position, loop, duration) 
  local soundNode = SoundNode(Preloader.instance():getSound(filename))
  soundNode:stop()
  soundNode:play()
  soundNode.loop = loop
  soundNode.translation = position
  soundNode.controllers:add(TimeTriggeredActionController(RemoveNodeAction(soundNode),duration))
  rootNode.children:add(soundNode)
end

sound.volumnes = {
  tinywalking = 0.5,
  tinyland = 0.25
  
}
