]> git.tdb.fi Git - libs/al.git/blobdiff - source/sound.h
Initial revision
[libs/al.git] / source / sound.h
diff --git a/source/sound.h b/source/sound.h
new file mode 100644 (file)
index 0000000..0e15a40
--- /dev/null
@@ -0,0 +1,43 @@
+/* $Id$
+
+This file is part of libmspal
+Copyright © 2008 Mikko Rasa, Mikkosoft Productions
+Diestributed under the LGPL
+*/
+
+#ifndef MSP_AL_SOUND_H_
+#define MSP_AL_SOUND_H_
+
+#include <vorbis/vorbisfile.h>
+#include "format.h"
+
+namespace Msp {
+namespace AL {
+
+class Sound
+{
+private:
+       OggVorbis_File ovfile;
+       unsigned freq;
+       unsigned size;
+       char *data;
+       Format format;
+
+public:
+       Sound();
+       ~Sound();
+
+       void open(const std::string &);
+       void load_data();
+       void load(const std::string &);
+       Format get_format() const { return format; }
+       unsigned get_frequency() const { return freq; }
+       unsigned get_size() const { return size; }
+       const char *get_data() const;
+       unsigned read(char *, unsigned);
+};
+
+} // namespace AL
+} // namespace Msp
+
+#endif