Audio.pkg 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. const PODVector<SoundSource*>& GetSoundSources() const;
  28. void AddSoundSource(SoundSource* soundSource);
  29. void RemoveSoundSource(SoundSource* soundSource);
  30. float GetSoundSourceMasterGain(SoundType type) const;
  31. void MixOutput(void *dest, unsigned samples);
  32. tolua_readonly tolua_property__get_set unsigned sampleSize;
  33. tolua_readonly tolua_property__get_set int mixRate;
  34. tolua_readonly tolua_property__get_set bool interpolation;
  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. tolua_property__get_set SoundListener* listener;
  39. };