1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
// ____ _ __
// / __ )____ _____ | | / /___ ___________
// / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
// / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
// /_____/\____/____/ |__/|__/\__,_/_/ /____/
//
// A futuristic real-time strategy game.
// This file is part of Bos Wars.
//
/**@name wav.h - The wav file format header file. */
//
// (c) Copyright 1998-2007 by Lutz Sammer
//
// 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; only version 2 of the License.
//
// 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
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#ifndef __WAV_H__
#define __WAV_H__
//@{
/*----------------------------------------------------------------------------
-- Wav
----------------------------------------------------------------------------*/
//
// Define values for WAV format
//
#define RIFF 0x46464952 /// "RIFF" chunk names.
#define WAVE 0x45564157 /// "WAVE" chunk names.
#define FMT 0x20746D66 /// "fmt " chunk names.
#define DATA 0x61746164 /// "data" chunk names.
/*
** Wav types
*/
#define WAV_UNKNOWN 0
#define WAV_PCM_CODE 1
#define WAV_ADPCM 2
#define WAV_ALAW 6
#define WAV_MULAW 7
#define WAV_OKI_ADPCM 16
#define WAV_DIGISTD 21
#define WAV_DIGIFIX 22
#define IBM_MULAW 0x0101
#define IBM_ALAW 0x0102
#define IBM_ADPCM 0x0103
#define WAV_MONO 1
#define WAV_STEREO 2
/**
** Wav format
*/
struct WavFMT {
unsigned int FMTchunk;
unsigned int FMTlength;
unsigned short Encoding; /// 1 = PCM
unsigned short Channels; /// 1 = mono, 2 = stereo
unsigned int Frequency; /// One of 11025, 22050, or 44100 Hz
unsigned int ByteRate; /// Average bytes per second
unsigned short SampleSize; /// Bytes per sample block
unsigned short BitsPerSample; /// One of 8, 12, 16
};
/**
** General chunk found in the WAV file
*/
struct WavChunk {
unsigned int Magic;
unsigned int Length;
};
//@}
#endif // !__WAV_H__
|