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
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.
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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 /**
24  * @file
25  * Sound decoder used in engines:
26  *  - access
27  *  - agos
28  *  - cge
29  *  - cge2
30  *  - fullpipe
31  *  - gob
32  *  - hopkins
33  *  - mohawk
34  *  - prince
35  *  - saga
36  *  - sci
37  *  - scumm
38  *  - sherlock
39  *  - sword1
40  *  - sword2
41  *	- titanic
42  *  - tony
43  *  - tucker
44  *  - wintermute
45  *  - zvision
46  */
47 
48 #ifndef AUDIO_WAVE_H
49 #define AUDIO_WAVE_H
50 
51 #include "common/scummsys.h"
52 #include "common/types.h"
53 
54 namespace Common {
55 class SeekableReadStream;
56 }
57 
58 namespace Audio {
59 
60 class SeekableAudioStream;
61 
62 /**
63  * Try to load a WAVE from the given seekable stream. Returns true if
64  * successful. In that case, the stream's seek position will be set to the
65  * start of the audio data, and size, rate and flags contain information
66  * necessary for playback. Currently this function supports uncompressed
67  * raw PCM data, MS IMA ADPCM and MS ADPCM (uses makeADPCMStream internally).
68  */
69 extern bool loadWAVFromStream(
70 	Common::SeekableReadStream &stream,
71 	int &size,
72 	int &rate,
73 	byte &flags,
74 	uint16 *wavType = 0,
75 	int *blockAlign = 0);
76 
77 /**
78  * Try to load a WAVE from the given seekable stream and create an AudioStream
79  * from that data. Currently this function supports uncompressed
80  * raw PCM data, MS IMA ADPCM and MS ADPCM (uses makeADPCMStream internally).
81  *
82  * This function uses loadWAVFromStream() internally.
83  *
84  * @param stream			the SeekableReadStream from which to read the WAVE data
85  * @param disposeAfterUse	whether to delete the stream after use
86  * @return	a new SeekableAudioStream, or NULL, if an error occurred
87  */
88 SeekableAudioStream *makeWAVStream(
89 	Common::SeekableReadStream *stream,
90 	DisposeAfterUse::Flag disposeAfterUse);
91 
92 } // End of namespace Audio
93 
94 #endif
95