Sound.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. function Sound() {
  2. }
  3. Sound.prototype.getSampleAsNumber = function(offset,channel) {
  4. return Polycode.Sound_getSampleAsNumber(this.__ptr, offset,channel)
  5. }
  6. Sound.prototype.loadFile = function(fileName) {
  7. Polycode.Sound_loadFile(this.__ptr, fileName)
  8. }
  9. Sound.prototype.Play = function(loop,restartSound) {
  10. Polycode.Sound_Play(this.__ptr, loop,restartSound)
  11. }
  12. Sound.prototype.Stop = function() {
  13. Polycode.Sound_Stop(this.__ptr)
  14. }
  15. Sound.prototype.setVolume = function(newVolume) {
  16. Polycode.Sound_setVolume(this.__ptr, newVolume)
  17. }
  18. Sound.prototype.getVolume = function() {
  19. return Polycode.Sound_getVolume(this.__ptr)
  20. }
  21. Sound.prototype.setPitch = function(newPitch) {
  22. Polycode.Sound_setPitch(this.__ptr, newPitch)
  23. }
  24. Sound.prototype.getPitch = function() {
  25. return Polycode.Sound_getPitch(this.__ptr)
  26. }
  27. Sound.prototype.isPlaying = function() {
  28. return Polycode.Sound_isPlaying(this.__ptr)
  29. }
  30. Sound.prototype.isLooped = function() {
  31. return Polycode.Sound_isLooped(this.__ptr)
  32. }
  33. Sound.prototype.setIsPositional = function(isPositional) {
  34. Polycode.Sound_setIsPositional(this.__ptr, isPositional)
  35. }
  36. Sound.prototype.setSoundPosition = function(position) {
  37. Polycode.Sound_setSoundPosition(this.__ptr, position)
  38. }
  39. Sound.prototype.setSoundVelocity = function(velocity) {
  40. Polycode.Sound_setSoundVelocity(this.__ptr, velocity)
  41. }
  42. Sound.prototype.setSoundDirection = function(direction) {
  43. Polycode.Sound_setSoundDirection(this.__ptr, direction)
  44. }
  45. Sound.prototype.setOffset = function(offset) {
  46. Polycode.Sound_setOffset(this.__ptr, offset)
  47. }
  48. Sound.prototype.getFileName = function() {
  49. return Polycode.Sound_getFileName(this.__ptr)
  50. }
  51. Sound.prototype.getPlaybackDuration = function() {
  52. return Polycode.Sound_getPlaybackDuration(this.__ptr)
  53. }
  54. Sound.prototype.getPlaybackTime = function() {
  55. return Polycode.Sound_getPlaybackTime(this.__ptr)
  56. }
  57. Sound.prototype.seekTo = function(time) {
  58. Polycode.Sound_seekTo(this.__ptr, time)
  59. }
  60. Sound.prototype.getOffset = function() {
  61. return Polycode.Sound_getOffset(this.__ptr)
  62. }
  63. Sound.prototype.getSampleLength = function() {
  64. return Polycode.Sound_getSampleLength(this.__ptr)
  65. }
  66. Sound.prototype.getFrequency = function() {
  67. return Polycode.Sound_getFrequency(this.__ptr)
  68. }
  69. Sound.prototype.setPositionalProperties = function(referenceDistance,maxDistance) {
  70. Polycode.Sound_setPositionalProperties(this.__ptr, referenceDistance,maxDistance)
  71. }
  72. Sound.prototype.setReferenceDistance = function(referenceDistance) {
  73. Polycode.Sound_setReferenceDistance(this.__ptr, referenceDistance)
  74. }
  75. Sound.prototype.setMaxDistance = function(maxDistance) {
  76. Polycode.Sound_setMaxDistance(this.__ptr, maxDistance)
  77. }
  78. Sound.prototype.getReferenceDistance = function() {
  79. return Polycode.Sound_getReferenceDistance(this.__ptr)
  80. }
  81. Sound.prototype.getMaxDistance = function() {
  82. return Polycode.Sound_getMaxDistance(this.__ptr)
  83. }
  84. Sound.prototype.loadBytes = function(data,size,channels,freq,format) {
  85. return Polycode.Sound_loadBytes(this.__ptr, data,size,channels,freq,format)
  86. }
  87. Sound.prototype.loadWAV = function(fileName) {
  88. return Polycode.Sound_loadWAV(this.__ptr, fileName)
  89. }
  90. Sound.prototype.loadOGG = function(fileName) {
  91. return Polycode.Sound_loadOGG(this.__ptr, fileName)
  92. }
  93. Sound.prototype.soundCheck = function(result,err) {
  94. Polycode.Sound_soundCheck(this.__ptr, result,err)
  95. }
  96. Sound.prototype.updateStream = function(streamCount) {
  97. Polycode.Sound_updateStream(this.__ptr, streamCount)
  98. }