ScummVM API documentation
audio_sample.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA8_AUDIO_AUDIOSAMPLE_H
23 #define ULTIMA8_AUDIO_AUDIOSAMPLE_H
24 
25 namespace Audio {
26 class SeekableAudioStream;
27 }
28 
29 namespace Ultima {
30 namespace Ultima8 {
31 
32 class AudioSample {
33 protected:
34  uint32 _sampleRate;
35  uint32 _bits;
36  bool _stereo;
37  uint32 _length;
38 
39  uint32 _bufferSize;
40  uint8 const *_buffer;
41 
42  bool _deleteBuffer;
43 
44 public:
45  AudioSample(const uint8 *buffer, uint32 size, uint32 bits, bool stereo, bool deleteBuffer);
46  virtual ~AudioSample(void);
47 
48  inline uint32 getRate() const {
49  return _sampleRate;
50  }
51  inline uint32 getBits() const {
52  return _bits;
53  }
54  inline bool isStereo() const {
55  return _stereo;
56  }
57 
59  inline uint32 getLength() const {
60  return _length;
61  }
62 
63  virtual Audio::SeekableAudioStream *makeStream() const = 0;
64 };
65 
66 } // End of namespace Ultima8
67 } // End of namespace Ultima
68 
69 #endif
uint32 getLength() const
get AudioSample _length (in samples)
Definition: audio_sample.h:59
Definition: audiostream.h:212
Definition: detection.h:27
Definition: audio_sample.h:32
Definition: system.h:38