_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

wav.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 1998-2001 by Lutz Sammer
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __WAV_H__
31 #define __WAV_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Wav
37 ----------------------------------------------------------------------------*/
38 
39 //
40 // Define values for WAV format
41 //
42 
43 #define RIFF 0x46464952
44 #define WAVE 0x45564157
45 #define FMT 0x20746D66
46 #define DATA 0x61746164
47 
48 /*
49 ** Wav types
50 */
51 #define WAV_UNKNOWN 0
52 #define WAV_PCM_CODE 1
53 #define WAV_ADPCM 2
54 #define WAV_ALAW 6
55 #define WAV_MULAW 7
56 #define WAV_OKI_ADPCM 16
57 #define WAV_DIGISTD 21
58 #define WAV_DIGIFIX 22
59 
60 #define IBM_MULAW 0x0101
61 #define IBM_ALAW 0x0102
62 #define IBM_ADPCM 0x0103
63 
64 #define WAV_MONO 1
65 #define WAV_STEREO 2
66 
70 struct WavHeader {
71  unsigned int MagicRiff;
72  unsigned int Length;
73  unsigned int MagicWave;
74 };
75 
79 struct WavFMT {
80  unsigned short Encoding;
81  unsigned short Channels;
82  unsigned int Frequency;
83  unsigned int ByteRate;
84  unsigned short SampleSize;
85  unsigned short BitsPerSample;
86 };
87 
91 struct WavChunk {
92  unsigned int Magic;
93  unsigned int Length;
94 };
96 
97 #endif // !__WAV_H__
WavFMT::SampleSize
unsigned short SampleSize
Average bytes per second.
Definition: wav.h:84
WavFMT::Encoding
unsigned short Encoding
Definition: wav.h:80
WavChunk
Definition: wav.h:91
WavFMT::BitsPerSample
unsigned short BitsPerSample
Bytes per sample block.
Definition: wav.h:85
WavFMT::Frequency
unsigned int Frequency
1 = mono, 2 = stereo
Definition: wav.h:82
WavHeader::MagicWave
unsigned int MagicWave
Definition: wav.h:73
WavHeader::MagicRiff
unsigned int MagicRiff
Definition: wav.h:71
WavFMT::ByteRate
unsigned int ByteRate
One of 11025, 22050, or 44100 Hz.
Definition: wav.h:83
WavFMT::Channels
unsigned short Channels
1 = PCM
Definition: wav.h:81
WavHeader
Definition: wav.h:70
WavChunk::Length
unsigned int Length
Definition: wav.h:93
WavHeader::Length
unsigned int Length
Definition: wav.h:72
WavChunk::Magic
unsigned int Magic
Definition: wav.h:92
WavFMT
Definition: wav.h:79
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.