1 /* ScummVM - Graphic Adventure Engine
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.
7 * This program 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 2
10 * of the License, or (at your option) any later version.
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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 * Sound decoder used in engines:
37 #include "common/scummsys.h"
38 #include "common/stream.h"
45 // There are several types of ADPCM encoding, only some are supported here
46 // For all the different encodings, refer to:
47 // http://wiki.multimedia.cx/index.php?title=Category:ADPCM_Audio_Codecs
48 // Usually, if the audio stream we're trying to play has the FourCC header
49 // string intact, it's easy to discern which encoding is used
51 kADPCMOki
, // Dialogic/Oki ADPCM (aka VOX)
52 kADPCMMSIma
, // Microsoft IMA ADPCM
53 kADPCMMS
, // Microsoft ADPCM
54 kADPCMTinsel4
, // 4-bit ADPCM used by the Tinsel engine
55 kADPCMTinsel6
, // 6-bit ADPCM used by the Tinsel engine
56 kADPCMTinsel8
, // 8-bit ADPCM used by the Tinsel engine
57 kADPCMIma
// Standard IMA ADPCM
61 * Takes an input stream containing ADPCM compressed sound data and creates
62 * an AudioStream from that.
64 * @param stream the SeekableReadStream from which to read the ADPCM data
65 * @param disposeAfterUse whether to delete the stream after use
66 * @param size how many bytes to read from the stream (0 = all)
67 * @param type the compression type used
68 * @param rate the sampling rate (default = 22050)
69 * @param channels the number of channels (default = 2)
70 * @param blockAlign block alignment ??? (default = 0)
71 * @param numLoop how many types the sounds should loop, 0 for infinite loop (default = 1)
72 * @return a new AudioStream, or NULL, if an error occured
74 AudioStream
*makeADPCMStream(
75 Common::SeekableReadStream
*stream
,
81 uint32 blockAlign
= 0,
84 } // End of namespace Audio