xoreos  0.0.5
adpcm.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 /* Based on ScummVM (<http://scummvm.org>) code, which is released
26  * under the terms of version 2 or later of the GNU General Public
27  * License.
28  *
29  * The original copyright note in ScummVM reads as follows:
30  *
31  * ScummVM is the legal property of its developers, whose names
32  * are too numerous to list here. Please refer to the COPYRIGHT
33  * file distributed with this source distribution.
34  *
35  * This program is free software; you can redistribute it and/or
36  * modify it under the terms of the GNU General Public License
37  * as published by the Free Software Foundation; either version 2
38  * of the License, or (at your option) any later version.
39  *
40  * This program is distributed in the hope that it will be useful,
41  * but WITHOUT ANY WARRANTY; without even the implied warranty of
42  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43  * GNU General Public License for more details.
44  *
45  * You should have received a copy of the GNU General Public License
46  * along with this program; if not, write to the Free Software
47  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
48  */
49 
50 #ifndef SOUND_DECODERS_ADPCM_H
51 #define SOUND_DECODERS_ADPCM_H
52 
53 #include "src/common/readstream.h"
54 
55 namespace Sound {
56 
57 class PacketizedAudioStream;
58 class RewindableAudioStream;
59 
60 // There are several types of ADPCM encoding, only some are supported here
61 // For all the different encodings, refer to:
62 // http://wiki.multimedia.cx/index.php?title=Category:ADPCM_Audio_Codecs
63 // Usually, if the audio stream we're trying to play has the FourCC header
64 // string intact, it's easy to discern which encoding is used
65 enum ADPCMTypes {
66  kADPCMMSIma, // Microsoft IMA ADPCM
67  kADPCMMS, // Microsoft ADPCM
68  kADPCMApple, // Apple QuickTime IMA ADPCM
69  kADPCMXbox // Microsoft Xbox ADPCM
70 };
71 
86 RewindableAudioStream *makeADPCMStream(
88  bool disposeAfterUse,
89  uint32 size, ADPCMTypes type,
90  int rate,
91  int channels,
92  uint32 blockAlign = 0);
93 
108 PacketizedAudioStream *makePacketizedADPCMStream(
109  ADPCMTypes type,
110  int rate,
111  int channels,
112  uint32 blockAlign = 0);
113 
114 } // End of namespace Sound
115 
116 #endif // SOUND_DECODERS_ADPCM_H
PacketizedAudioStream * makePacketizedADPCMStream(ADPCMTypes type, int rate, int channels, uint32 blockAlign)
Creates a PacketizedAudioStream that will automatically queue packets as individual AudioStreams like...
Definition: adpcm.cpp:673
Definition: game.h:37
RewindableAudioStream * makeADPCMStream(Common::SeekableReadStream *stream, bool disposeAfterUse, uint32 size, ADPCMTypes type, int rate, int channels, uint32 blockAlign)
Takes an input stream containing ADPCM compressed sound data and creates an RewindableAudioStream fro...
Definition: adpcm.cpp:640
Basic reading stream interfaces.
ADPCMTypes
Definition: adpcm.h:65
uint32_t uint32
Definition: types.h:204
Interface for a seekable & readable data stream.
Definition: readstream.h:265