1. Architectural Role & Engine Purpose
The WAV (Waveform Audio File) format stores all positional 3D sound effects, weapon audio (gunshots, reloads, silencer clicks), environmental ambient loops (wind howling, electrical hums), and mission dialogue speech in Project I.G.I. 1.
Audio files adhere to the Microsoft RIFF WAVE specification, standardizing on uncompressed 16-bit linear PCM at 22,050 Hz or 44,100 Hz. Mono audio tracks are streamed into hardware-accelerated DirectSound3D buffers for realistic spatial panning and distance attenuation.
2. Binary File Layout & Memory Map Diagram
A WAV file contains standard RIFF chunks with format metadata, loop points, and raw PCM audio samples:
3. DirectSound3D Positional Spatialization Pipeline Diagram
When an event emits sound, the audio engine computes distance falloff and updates DirectSound 3D buffers:
4. Architectural Mechanics & Engine Implementation Details
Innerloop designed the audio architecture for stealth tactical awareness:
- Mono Spatialization: All in-game sound effects are strictly mono. Mono samples allow DirectSound3D to compute HRTF panning and distance falloff. Stereo is reserved exclusively for non-positional music.
- Environmental Occlusion: Sound rays test the collision octree (
.ctr). If solid concrete walls occlude the sound source, high frequencies are rolled off, allowing players to hear guards talking through doors with realistic muffled attenuation.
5. C++ Struct Definitions
#pragma pack(push, 1)
struct WavRiffHeader {
char riff[4]; // "RIFF"
uint32_t file_size; // Size - 8
char wave[4]; // "WAVE"
};
struct WavFmtChunk {
char fmt[4]; // "fmt "
uint32_t chunk_size; // 16
uint16_t audio_format; // 1 = PCM
uint16_t num_channels; // 1=Mono, 2=Stereo
uint32_t sample_rate; // 22050 or 44100
uint32_t byte_rate; // SampleRate * BlockAlign
uint16_t block_align; // Channels * 2
uint16_t bits_per_sample;// 16
};
static_assert(sizeof(WavFmtChunk) == 24, "WavFmtChunk must be 24 bytes");
#pragma pack(pop)