Audio.pkg 1.4 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. bool SetMode(int bufferLengthMSec, int mixRate, bool stereo, bool interpolation = true);
  14. bool Play();
  15. void Stop();
  16. void SetMasterGain(SoundType type, float gain);
  17. void SetListener(SoundListener* listener);
  18. void StopSound(Sound* sound);
  19. unsigned GetSampleSize() const;
  20. int GetMixRate() const;
  21. bool GetInterpolation() const;
  22. bool IsStereo() const;
  23. bool IsPlaying() const;
  24. bool IsInitialized() const;
  25. float GetMasterGain(SoundType type) const;
  26. SoundListener* GetListener() const;
  27. void AddSoundSource(SoundSource* soundSource);
  28. void RemoveSoundSource(SoundSource* soundSource);
  29. float GetSoundSourceMasterGain(SoundType type) const;
  30. void MixOutput(void *dest, unsigned samples);
  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_property__get_set SoundListener* listener;
  35. tolua_readonly tolua_property__is_set bool stereo;
  36. tolua_readonly tolua_property__is_set bool playing;
  37. tolua_readonly tolua_property__is_set bool initialized;
  38. };