Sound.pkg 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. $#include "Sound.h"
  2. /// %Sound resource.
  3. class Sound : public Resource
  4. {
  5. public:
  6. /// Set uncompressed sound data format.
  7. void SetFormat(unsigned frequency, bool sixteenBit, bool stereo);
  8. /// Set loop on/off. If loop is enabled, sets the full sound as loop range.
  9. void SetLooped(bool enable);
  10. /// Define loop.
  11. void SetLoop(unsigned repeatOffset, unsigned endOffset);
  12. /// Fix interpolation by copying data from loop start to loop end (looped), or adding silence (oneshot.)
  13. void FixInterpolation();
  14. /// Return length in seconds.
  15. float GetLength() const;
  16. /// Return total sound data size.
  17. unsigned GetDataSize() const { return dataSize_; }
  18. /// Return sample size.
  19. unsigned GetSampleSize() const;
  20. /// Return default frequency as a float.
  21. float GetFrequency() { return (float)frequency_; }
  22. /// Return default frequency as an integer.
  23. unsigned GetIntFrequency() { return frequency_; }
  24. /// Return whether is looped.
  25. bool IsLooped() const { return looped_; }
  26. /// Return whether data is sixteen bit.
  27. bool IsSixteenBit() const { return sixteenBit_; }
  28. /// Return whether data is stereo.
  29. bool IsStereo() const { return stereo_; }
  30. /// Return whether is compressed in Ogg Vorbis format.
  31. bool IsCompressed() const { return compressed_; }
  32. };