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