]> git.tdb.fi Git - libs/al.git/blob - source/sound.h
e903bcb395acf185df355f444793557a4c590b2f
[libs/al.git] / source / sound.h
1 /* $Id$
2
3 This file is part of libmspal
4 Copyright © 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_AL_SOUND_H_
9 #define MSP_AL_SOUND_H_
10
11 #include <vorbis/vorbisfile.h>
12 #include "format.h"
13
14 namespace Msp {
15 namespace AL {
16
17 class Sound
18 {
19 private:
20         OggVorbis_File ovfile;
21         unsigned freq;
22         unsigned size;
23         char *data;
24         Format format;
25
26 public:
27         Sound();
28         ~Sound();
29
30         void open(const std::string &);
31         void load_data();
32         void load(const std::string &);
33         Format get_format() const { return format; }
34         unsigned get_frequency() const { return freq; }
35         unsigned get_size() const { return size; }
36         const char *get_data() const;
37         unsigned read(char *, unsigned);
38 };
39
40 } // namespace AL
41 } // namespace Msp
42
43 #endif