Sound.lua 839 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. class "Sound"
  2. function Sound:Sound(fileName)
  3. if self.__ptr == nil then
  4. self.__ptr = Polycore.Sound(fileName)
  5. end
  6. end
  7. function Sound:Play(once)
  8. return Polycore.Sound_Play(self.__ptr, once)
  9. end
  10. function Sound:Stop()
  11. return Polycore.Sound_Stop(self.__ptr)
  12. end
  13. function Sound:loadWAV(fileName)
  14. return Polycore.Sound_loadWAV(self.__ptr, fileName)
  15. end
  16. function Sound:loadOGG(fileName)
  17. return Polycore.Sound_loadOGG(self.__ptr, fileName)
  18. end
  19. function Sound:GenSource(buffer)
  20. return Polycore.Sound_GenSource(self.__ptr, buffer.__ptr)
  21. end
  22. function Sound:checkALError(operation)
  23. return Polycore.Sound_checkALError(self.__ptr, operation)
  24. end
  25. function Sound:soundError(err)
  26. return Polycore.Sound_soundError(self.__ptr, err)
  27. end
  28. function Sound:soundCheck(result, err)
  29. return Polycore.Sound_soundCheck(self.__ptr, result, err)
  30. end