Audio.pkg 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $#include "Audio.h"
  2. enum SoundType
  3. {
  4. SOUND_EFFECT,
  5. SOUND_AMBIENT,
  6. SOUND_VOICE,
  7. SOUND_MUSIC,
  8. SOUND_MASTER,
  9. MAX_SOUND_TYPES
  10. };
  11. class Audio : public Object
  12. {
  13. public:
  14. // Methods:
  15. bool SetMode(int bufferLengthMSec, int mixRate, bool stereo, bool interpolation = true);
  16. bool SetMode(int bufferLengthMSec, int mixRate, bool stereo);
  17. bool Play();
  18. void Stop();
  19. void SetMasterGain(SoundType type, float gain);
  20. float GetMasterGain(SoundType type) const;
  21. void SetListener(SoundListener* listener);
  22. SoundListener* GetListener() const;
  23. unsigned GetSampleSize() const;
  24. int GetMixRate() const;
  25. bool GetInterpolation() const;
  26. bool IsStereo() const;
  27. bool IsPlaying() const;
  28. bool IsInitialized() const;
  29. // Properties:
  30. tolua_property__get_set SoundListener* listener;
  31. tolua_readonly tolua_property__get_set unsigned sampleSize;
  32. tolua_readonly tolua_property__get_set int mixRate;
  33. tolua_readonly tolua_property__get_set bool interpolation;
  34. tolua_readonly tolua_property__is_set bool stereo;
  35. tolua_readonly tolua_property__is_set bool playing;
  36. tolua_readonly tolua_property__is_set bool initialized;
  37. };