SoundManager.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. function SoundManager() {
  2. }
  3. Duktape.fin(SoundManager.prototype, function (x) {
  4. if (x === SoundManager.prototype) {
  5. return;
  6. }
  7. Polycode.SoundManager__delete(x.__ptr)
  8. })
  9. SoundManager.prototype.setListenerPosition = function(position) {
  10. Polycode.SoundManager_setListenerPosition(this.__ptr, position)
  11. }
  12. SoundManager.prototype.setListenerOrientation = function(orientation) {
  13. Polycode.SoundManager_setListenerOrientation(this.__ptr, orientation)
  14. }
  15. SoundManager.prototype.recordSound = function(rate,sampleSize) {
  16. return Polycode.SoundManager_recordSound(this.__ptr, rate,sampleSize)
  17. }
  18. SoundManager.prototype.stopRecording = function(generateFloatBuffer) {
  19. var retVal = new Sound()
  20. retVal.__ptr = Polycode.SoundManager_stopRecording(this.__ptr, generateFloatBuffer)
  21. return retVal
  22. }
  23. SoundManager.prototype.setAudioInterface = function(audioInterface) {
  24. Polycode.SoundManager_setAudioInterface(this.__ptr, audioInterface)
  25. }
  26. SoundManager.prototype.Update = function() {
  27. Polycode.SoundManager_Update(this.__ptr)
  28. }
  29. SoundManager.prototype.setGlobalVolume = function(globalVolume) {
  30. Polycode.SoundManager_setGlobalVolume(this.__ptr, globalVolume)
  31. }
  32. SoundManager.prototype.registerSound = function(sound) {
  33. Polycode.SoundManager_registerSound(this.__ptr, sound)
  34. }
  35. SoundManager.prototype.unregisterSound = function(sound) {
  36. Polycode.SoundManager_unregisterSound(this.__ptr, sound)
  37. }