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-05-03 20:36:07 +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.
|
2014-02-18 02:34:17 +01:00
|
|
|
*
|
2005-05-03 20:36:07 +00:00
|
|
|
* 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.
|
2014-02-18 02:34:17 +01:00
|
|
|
*
|
2005-05-03 20:36:07 +00:00
|
|
|
* 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-05-03 20:36:07 +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
|
2011-01-21 14:37:46 +00:00
|
|
|
* - lastexpress
|
|
|
|
* - mohawk
|
2009-03-08 15:57:59 +00:00
|
|
|
* - saga
|
|
|
|
* - scumm
|
|
|
|
* - tinsel
|
|
|
|
*/
|
|
|
|
|
2011-10-28 12:27:50 +02:00
|
|
|
#ifndef AUDIO_ADPCM_H
|
|
|
|
#define AUDIO_ADPCM_H
|
2005-05-03 20:36:07 +00:00
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2011-04-13 12:29:17 +02:00
|
|
|
#include "common/types.h"
|
|
|
|
|
2011-04-25 22:29:26 +03:00
|
|
|
namespace Common {
|
|
|
|
class SeekableReadStream;
|
|
|
|
}
|
2005-05-03 20:36:07 +00:00
|
|
|
|
2006-04-29 22:33:31 +00:00
|
|
|
|
|
|
|
namespace Audio {
|
|
|
|
|
2010-01-07 16:08:41 +00:00
|
|
|
class RewindableAudioStream;
|
2005-05-03 20:36:07 +00:00
|
|
|
|
2007-12-01 16:31:10 +00:00
|
|
|
// There are several types of ADPCM encoding, only some are supported here
|
2008-01-27 19:47:41 +00:00
|
|
|
// For all the different encodings, refer to:
|
2007-12-01 16:31:10 +00:00
|
|
|
// http://wiki.multimedia.cx/index.php?title=Category:ADPCM_Audio_Codecs
|
|
|
|
// Usually, if the audio stream we're trying to play has the FourCC header
|
|
|
|
// string intact, it's easy to discern which encoding is used
|
2013-04-20 15:18:09 -04:00
|
|
|
enum ADPCMType {
|
2010-10-18 19:10:57 +00:00
|
|
|
kADPCMOki, // Dialogic/Oki ADPCM (aka VOX)
|
|
|
|
kADPCMMSIma, // Microsoft IMA ADPCM
|
|
|
|
kADPCMMS, // Microsoft ADPCM
|
2011-04-13 09:43:08 -04:00
|
|
|
kADPCMDVI, // Intel DVI IMA ADPCM
|
2010-11-11 17:04:07 +00:00
|
|
|
kADPCMApple, // Apple QuickTime IMA ADPCM
|
|
|
|
kADPCMDK3 // Duck DK3 IMA ADPCM
|
2005-05-03 20:36:07 +00:00
|
|
|
};
|
|
|
|
|
2007-11-16 10:05:18 +00:00
|
|
|
/**
|
|
|
|
* Takes an input stream containing ADPCM compressed sound data and creates
|
2010-01-07 16:08:41 +00:00
|
|
|
* an RewindableAudioStream from that.
|
2007-11-16 10:05:18 +00:00
|
|
|
*
|
2010-01-07 16:08:41 +00:00
|
|
|
* @param stream the SeekableReadStream from which to read the ADPCM data
|
|
|
|
* @param disposeAfterUse whether to delete the stream after use
|
|
|
|
* @param size how many bytes to read from the stream (0 = all)
|
|
|
|
* @param type the compression type used
|
|
|
|
* @param rate the sampling rate
|
|
|
|
* @param channels the number of channels
|
|
|
|
* @param blockAlign block alignment ???
|
2010-06-15 12:33:20 +00:00
|
|
|
* @return a new RewindableAudioStream, or NULL, if an error occurred
|
2007-11-16 10:05:18 +00:00
|
|
|
*/
|
2010-01-07 16:08:41 +00:00
|
|
|
RewindableAudioStream *makeADPCMStream(
|
|
|
|
Common::SeekableReadStream *stream,
|
2010-01-31 02:11:41 +00:00
|
|
|
DisposeAfterUse::Flag disposeAfterUse,
|
2013-04-20 15:18:09 -04:00
|
|
|
uint32 size, ADPCMType type,
|
2013-04-20 14:54:41 -04:00
|
|
|
int rate,
|
|
|
|
int channels,
|
2010-01-07 16:08:41 +00:00
|
|
|
uint32 blockAlign = 0);
|
2005-10-19 04:59:18 +00:00
|
|
|
|
2006-04-29 22:33:31 +00:00
|
|
|
} // End of namespace Audio
|
2005-05-03 20:36:07 +00:00
|
|
|
|
|
|
|
#endif
|