1 #ifndef MSP_AL_SOUNDDECODER_H_
2 #define MSP_AL_SOUNDDECODER_H_
5 #include <msp/io/seekable.h>
11 class unsupported_sound: public std::runtime_error
14 unsupported_sound(const std::string &);
15 virtual ~unsupported_sound() throw() { }
20 This class facilitates loading sound files. Currently only Ogg Vorbis is
35 virtual ~SoundDecoder();
37 static SoundDecoder *open_file(const std::string &);
38 static SoundDecoder *open_io(IO::Seekable &);
40 virtual void rewind() = 0;
41 virtual unsigned read(char *, unsigned) = 0;
42 bool eof() const { return eof_flag; }
44 Format get_format() const { return format; }
45 unsigned get_frequency() const { return freq; }
46 unsigned get_size() const { return size; }