22 #ifndef FIFE_SOUNDDECODER_H
23 #define FIFE_SOUNDDECODER_H
36 #include "soundconfig.h"
37 #include "fife_openal.h"
44 virtual ~SoundDecoder() {}
48 virtual uint64_t getDecodedLength()
const = 0;
59 bool needsStreaming()
const {
return getDecodedLength() > MAX_KEEP_IN_MEM; }
65 virtual bool setCursor(uint64_t pos) = 0;
72 virtual bool decode(uint64_t length) = 0;
78 virtual void *getBuffer()
const = 0;
82 virtual uint64_t getBufferSize() = 0;
86 virtual void releaseBuffer() = 0;
92 bool isStereo()
const {
98 ALenum getALFormat()
const {
100 return m_is8bit ? AL_FORMAT_STEREO8 : AL_FORMAT_STEREO16;
102 return m_is8bit ? AL_FORMAT_MONO8 : AL_FORMAT_MONO16;
108 int16_t getBitResolution()
const {
109 return m_is8bit ? 8 : 16;
114 uint64_t getSampleRate()
const{
121 uint64_t m_samplerate;