ScummVM API documentation
sonarc_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_SONARCAUDIOSAMPLE_H
23#define ULTIMA8_AUDIO_SONARCAUDIOSAMPLE_H
24
25#include "common/scummsys.h"
26#include "ultima/ultima8/audio/audio_sample.h"
27
28namespace Ultima {
29namespace Ultima8 {
30
32 struct SonarcDecompData {
33 uint32 _pos;
34 uint32 _samplePos;
35 };
36
37 static bool _generatedOneTable;
38 static int _oneTable[256];
39
40 static void GenerateOneTable();
41
42 static void decode_EC(int mode, int samplecount,
43 const uint8 *source, int sourcesize,
44 uint8 *dest);
45 static void decode_LPC(int order, int nsamples,
46 uint8 *dest, const uint8 *factors);
47 static int audio_decode(const uint8 *source, uint8 *dest);
48
49 int _frameSize;
50 uint32 _srcOffset;
51
52public:
53 SonarcAudioSample(const uint8 *buffer, uint32 size);
54 ~SonarcAudioSample(void) override;
55
56 Audio::SeekableAudioStream *makeStream() const override;
57
58private:
59 uint32 decompressFrame(SonarcDecompData *decompData, uint8 *samples) const;
60};
61
62} // End of namespace Ultima8
63} // End of namespace Ultima
64
65#endif
Definition: audiostream.h:212
Definition: audio_sample.h:34
Definition: sonarc_audio_sample.h:31