MP3, BMP & JPG -- Modern Media Formats

1. Architectural Role & Engine Purpose

The MP3-BMP-JPG (Multimedia Audio & Imagery Suite) format group handles menu soundtrack streaming, tactical photographic intelligence briefings, and high-resolution HUD artwork in I.G.I. 2: Covert Strike.

Unlike IGI 1 which relied exclusively on uncompressed WAV audio, IGI 2 integrated an MPEG-1 Audio Layer III (MP3) streaming decoder for its iconic main menu music and cinematic soundtracks, alongside standard Windows BMP and JPEG JFIF containers for satellite surveillance imagery.

2. Binary File Layout & Memory Map Diagram

The multimedia subsystem streams MP3 audio packets and loads compressed photographic bitmaps:

IGI 2 MP3-BMP-JPG — MULTIMEDIA STREAMING & ARTWORK LAYOUT 0x00: MP3 Frame Synchronization Header MPEG-1 LAYER 3 11-Bit Sync Word (0xFFE) | MPEG-1 Layer III | Bitrate Index (128-256 kbps) | Sample Rate (44.1 kHz) | Stereo sync(11b), version(2b), layer(2b), bitrate(4b), samplerate(2b), padding(1b), channel_mode(2b) Huffman Compressed Frequency Subband Audio Stream AUDIO FRAMES Sequential MP3 frames decoded in real-time into DirectSound ring buffers for iconic menu themes Seamless soundtrack streaming with zero CD-ROM read stutter Briefing Image Containers: Windows BMP & JPEG JFIF BRIEFING IMAGES Standard Windows BITMAPINFOHEADER (54 Bytes) or JPEG SOI (0xFFD8) photographic intelligence files Photographic satellite surveillance intelligence and target dossiers

3. MP3 Audio Streaming & Circular Ring Buffer Pipeline Diagram

The background streaming thread decodes MP3 frames into a DirectSound circular ring buffer:

IGI 2 MP3 — AUDIO STREAMING & RING BUFFER PIPELINE 1. STREAM THREAD • Read SOUNDS/MENU.MP3 • 16 KB Staging Buffer • Background Worker 2. FRAME SYNC • Scan 0xFFE Sync Word • Read Frame Bitrate • Validate Stereo Mode 3. HUFFMAN DECODE • Software IMDCT Decode • 1152 Stereo PCM Samples • Write to DirectSound 4. CONTINUOUS LOOP • Circular Ring Buffer • Zero Track Pauses • Iconic Theme Music

4. C++ Struct Definitions

#pragma pack(push, 1)
struct Mp3FrameHeader {
    uint32_t sync_word    : 11; // 0x7FF (All 1s)
    uint32_t version      : 2;  // 1 = MPEG-1
    uint32_t layer        : 2;  // 1 = Layer III
    uint32_t protection   : 1;  // CRC flag
    uint32_t bitrate_idx  : 4;  // Bitrate index
    uint32_t samplerate   : 2;  // 0 = 44100 Hz
    uint32_t padding      : 1;  // Frame padding
    uint32_t private_bit  : 1;
    uint32_t channel_mode : 2;  // 0=Stereo, 1=Joint Stereo
    uint32_t mode_ext     : 2;
    uint32_t copyright    : 1;
    uint32_t original     : 1;
    uint32_t emphasis     : 2;
};
static_assert(sizeof(Mp3FrameHeader) == 4, "Mp3FrameHeader must be 4 bytes");
#pragma pack(pop)