2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2005-01-09 15:49:43 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-01-09 15:49:43 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-03-08 15:57:59 +00:00
|
|
|
/**
|
2009-11-25 10:55:25 +00:00
|
|
|
* @file
|
2009-03-08 15:57:59 +00:00
|
|
|
* Sound decoder used in engines:
|
|
|
|
* - agos
|
|
|
|
* - gob
|
2011-01-21 14:37:46 +00:00
|
|
|
* - mohawk
|
2009-03-08 15:57:59 +00:00
|
|
|
* - saga
|
2011-01-21 14:37:46 +00:00
|
|
|
* - sci
|
2009-03-08 15:57:59 +00:00
|
|
|
* - scumm
|
|
|
|
* - sword1
|
|
|
|
* - sword2
|
|
|
|
* - tucker
|
|
|
|
*/
|
|
|
|
|
2011-10-28 10:27:50 +00:00
|
|
|
#ifndef AUDIO_WAVE_H
|
|
|
|
#define AUDIO_WAVE_H
|
2005-01-09 15:49:43 +00:00
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2010-06-15 12:33:20 +00:00
|
|
|
#include "common/types.h"
|
2005-01-09 15:49:43 +00:00
|
|
|
|
2011-04-25 19:29:26 +00:00
|
|
|
namespace Common {
|
|
|
|
class SeekableReadStream;
|
|
|
|
}
|
2005-01-09 15:49:43 +00:00
|
|
|
|
2006-04-29 22:33:31 +00:00
|
|
|
namespace Audio {
|
|
|
|
|
2010-01-07 16:34:56 +00:00
|
|
|
class RewindableAudioStream;
|
2006-04-29 22:33:31 +00:00
|
|
|
|
2005-01-09 15:49:43 +00:00
|
|
|
/**
|
2006-03-19 14:11:32 +00:00
|
|
|
* Try to load a WAVE from the given seekable stream. Returns true if
|
|
|
|
* successful. In that case, the stream's seek position will be set to the
|
|
|
|
* start of the audio data, and size, rate and flags contain information
|
2009-01-27 00:42:43 +00:00
|
|
|
* necessary for playback. Currently this function supports uncompressed
|
|
|
|
* raw PCM data, MS IMA ADPCM and MS ADPCM (uses makeADPCMStream internally).
|
2005-01-09 15:49:43 +00:00
|
|
|
*/
|
2007-11-16 10:05:18 +00:00
|
|
|
extern bool loadWAVFromStream(
|
|
|
|
Common::SeekableReadStream &stream,
|
|
|
|
int &size,
|
|
|
|
int &rate,
|
|
|
|
byte &flags,
|
|
|
|
uint16 *wavType = 0,
|
|
|
|
int *blockAlign = 0);
|
2005-01-09 15:49:43 +00:00
|
|
|
|
2006-03-19 14:11:32 +00:00
|
|
|
/**
|
|
|
|
* Try to load a WAVE from the given seekable stream and create an AudioStream
|
2009-01-27 00:42:43 +00:00
|
|
|
* from that data. Currently this function supports uncompressed
|
|
|
|
* raw PCM data, MS IMA ADPCM and MS ADPCM (uses makeADPCMStream internally).
|
2006-03-19 14:11:32 +00:00
|
|
|
*
|
|
|
|
* This function uses loadWAVFromStream() internally.
|
2009-01-27 00:42:43 +00:00
|
|
|
*
|
|
|
|
* @param stream the SeekableReadStream from which to read the WAVE data
|
|
|
|
* @param disposeAfterUse whether to delete the stream after use
|
2010-06-15 12:33:20 +00:00
|
|
|
* @return a new RewindableAudioStream, or NULL, if an error occurred
|
2006-03-19 14:11:32 +00:00
|
|
|
*/
|
2010-01-07 16:34:56 +00:00
|
|
|
RewindableAudioStream *makeWAVStream(
|
2009-01-27 00:42:43 +00:00
|
|
|
Common::SeekableReadStream *stream,
|
2010-01-16 21:36:08 +00:00
|
|
|
DisposeAfterUse::Flag disposeAfterUse);
|
2005-01-09 15:49:43 +00:00
|
|
|
|
2006-04-29 22:33:31 +00:00
|
|
|
} // End of namespace Audio
|
|
|
|
|
2005-01-09 15:49:43 +00:00
|
|
|
#endif
|