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#include "common/scummsys.h"
26
27namespace Audio {
28class SeekableAudioStream;
29}
30
31namespace Ultima {
32namespace Ultima8 {
33
35protected:
36 uint32 _sampleRate;
37 uint32 _bits;
38 bool _stereo;
39 uint32 _length;
40
41 uint32 _bufferSize;
42 uint8 const *_buffer;
43
44 bool _deleteBuffer;
45
46public:
47 AudioSample(const uint8 *buffer, uint32 size, uint32 bits, bool stereo, bool deleteBuffer);
48 virtual ~AudioSample(void);
49
50 inline uint32 getRate() const {
51 return _sampleRate;
52 }
53 inline uint32 getBits() const {
54 return _bits;
55 }
56 inline bool isStereo() const {
57 return _stereo;
58 }
59
61 inline uint32 getLength() const {
62 return _length;
63 }
64
65 virtual Audio::SeekableAudioStream *makeStream() const = 0;
66};
67
68} // End of namespace Ultima8
69} // End of namespace Ultima
70
71#endif
Definition: audiostream.h:212
Definition: audio_sample.h:34
uint32 getLength() const
get AudioSample _length (in samples)
Definition: audio_sample.h:61
Definition: system.h:39