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.
|
2007-04-09 09:58:41 +00:00
|
|
|
*
|
2021-12-26 18:47:58 +01: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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2014-02-18 02:34:17 +01:00
|
|
|
*
|
2007-04-09 09:58:41 +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
|
|
|
*
|
2007-04-09 09:58:41 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2007-04-09 09:58:41 +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:
|
2015-06-04 18:44:02 -04:00
|
|
|
* - bbvs
|
2012-08-31 22:26:02 -04:00
|
|
|
* - pegasus
|
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
|
|
|
* - sword1
|
|
|
|
*/
|
|
|
|
|
2011-10-28 12:27:50 +02:00
|
|
|
#ifndef AUDIO_AIFF_H
|
|
|
|
#define AUDIO_AIFF_H
|
2007-04-09 09:58:41 +00:00
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2010-06-15 12:33:54 +00:00
|
|
|
#include "common/types.h"
|
2007-04-09 09:58:41 +00:00
|
|
|
|
2011-04-25 22:29:26 +03:00
|
|
|
namespace Common {
|
|
|
|
class SeekableReadStream;
|
|
|
|
}
|
2007-04-09 09:58:41 +00:00
|
|
|
|
|
|
|
namespace Audio {
|
|
|
|
|
2015-06-05 22:49:03 -04:00
|
|
|
class RewindableAudioStream;
|
2007-04-09 09:58:41 +00:00
|
|
|
|
2022-04-02 23:40:05 +02:00
|
|
|
class AIFFHeader {
|
|
|
|
public:
|
|
|
|
static AIFFHeader *readAIFFHeader(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse);
|
|
|
|
RewindableAudioStream *makeAIFFStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse);
|
|
|
|
|
|
|
|
uint32 getFrameCount() const { return _frameCount; }
|
|
|
|
uint32 getFrameRate() const { return _rate; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint16 _channels = 0;
|
|
|
|
uint32 _frameCount = 0;
|
|
|
|
uint16 _bitsPerSample = 0;
|
|
|
|
uint32 _rate = 0;
|
|
|
|
uint32 _codec = 0;
|
|
|
|
Common::SeekableReadStream *_dataStream = nullptr;
|
|
|
|
};
|
|
|
|
|
2007-04-09 09:58:41 +00:00
|
|
|
/**
|
|
|
|
* Try to load an AIFF from the given seekable stream and create an AudioStream
|
|
|
|
* from that data.
|
|
|
|
*
|
2010-06-15 12:33:54 +00:00
|
|
|
* @param stream the SeekableReadStream from which to read the AIFF data
|
|
|
|
* @param disposeAfterUse whether to delete the stream after use
|
|
|
|
* @return a new SeekableAudioStream, or NULL, if an error occurred
|
2007-04-09 09:58:41 +00:00
|
|
|
*/
|
2015-06-05 22:49:03 -04:00
|
|
|
RewindableAudioStream *makeAIFFStream(
|
2015-06-06 22:50:36 +02:00
|
|
|
Common::SeekableReadStream *stream,
|
|
|
|
DisposeAfterUse::Flag disposeAfterUse);
|
|
|
|
|
2007-04-09 09:58:41 +00:00
|
|
|
} // End of namespace Audio
|
|
|
|
|
|
|
|
#endif
|