Audio System
Free Eggbert supports two audio backends, selected at compile time via the
_BASS flag in include/def.hpp.
Audio Backends
| Backend | Flag | Source File | Status |
|---|---|---|---|
| DirectSound / MCI | _BASS=FALSE (default) |
src/sound.cpp |
Default / Active |
| BASS + BASSMIDI library | _BASS=TRUE |
src/soundbass.cpp |
Alternative |
_BASS=FALSE (DirectSound/MCI path active).
The documentation may be outdated; verify the current build configuration.
CSound Class
Header: include/sound.hpp
Implementation: src/sound.cpp (DirectSound) or
src/soundbass.cpp (BASS)
The CSound class is responsible for loading and playing all audio.
It is instantiated in src/blupi.cpp during application startup.
Key features:
- Loads
.blpsound files fromgamefiles/SOUND/ - Supports 3D positional audio — sounds play louder when the player is nearby
- Music tracks loop and change when transitioning between regions
- Vehicle sounds loop and vary in pitch based on vehicle state
DirectSound Backend (Default)
File: src/sound.cpp
Active when: _BASS=FALSE (default)
Uses the Win32 DirectSound API (via Free Direct / SDL3 abstraction on non-Windows platforms). Wraps DirectSound buffer management for loading and playback of WAV-format sound data.
WAV file loading is handled separately by src/wave.cpp (include/wave.hpp).
BASS Library Backend
File: src/soundbass.cpp
Active when: _BASS=TRUE
Uses the BASS audio library and BASSMIDI
for MIDI music support. Library binaries are located in the bass/ subdirectory.
To switch to the BASS backend, change in include/def.hpp:
// Default (DirectSound/MCI):
#define _BASS FALSE
// To enable BASS library:
#define _BASS TRUE
Music
10 background music tracks: MUSIC000.BLP through MUSIC009.BLP
in gamefiles/SOUND/ (uppercase extension on disk).
- Music track selection is stored per-level in
DescFile::music - Music stops and changes when transitioning between regions
- Current music is tracked in
DescSave::music
Sound Effects
93 sound effect files in gamefiles/SOUND/ (indices 0–92):
SOUND000.BLP–SOUND065.BLP (uppercase) and
sound066.blp–sound092.blp (lowercase).
Plus a special SOUND_MOVIE=99 marker (not a real sample file).
Sound effects are organized by category. See the full Sound Effects Reference for all constants.
Sound Categories
| Category | Examples |
|---|---|
| UI/Menu | SOUND_CLICK (0), SOUND_ERROR (27) |
| Movement / Jumping | SOUND_JUMP0–2, SOUND_JUMPEND, SOUND_FALL |
| Footsteps (surface variants) | Wood, metal, cave, slime, plastic, cheese, grass |
| Helicopter | SOUND_HELICOSTART/HIGH/STOP/LOW |
| Jeep | SOUND_JEEPSTART/HIGH/STOP/LOW |
| Water | SOUND_PLOUF, SOUND_BLUP, SOUND_DROWN |
| Combat / Bombs | SOUND_BOUM, SOUND_GLU, SOUND_ELECTRO |
| Power-ups | SOUND_STARTSHIELD/STOPSHIELD, SOUND_STARTPOWER/STOPPOWER |
| Collectibles / Goals | SOUND_TRESOR, SOUND_EGG, SOUND_ENDOK |
| Level mechanics | SOUND_DOOR, SOUND_TELEPORTE, SOUND_BRIDGE1/2 |
| Character reactions | SOUND_VERTIGO, SOUND_BYE, SOUND_MOCKERY |
Surface-Specific Footsteps
The game uses different landing/footstep sounds depending on the surface type Blupi is
standing on. Each surface type has two sounds:
a landing sound (JUMPEND*) and a step sound (JUMPTOC*).
| Surface | JUMPEND constant | JUMPTOC constant |
|---|---|---|
| Default (stone) | SOUND_JUMPEND (3) | SOUND_JUMPTOC (4) |
| Wood | SOUND_JUMPENDb (78) | SOUND_JUMPTOCb (79) |
| Metal | SOUND_JUMPENDm (80) | SOUND_JUMPTOCm (81) |
| Cave | SOUND_JUMPENDg (82) | SOUND_JUMPTOCg (83) |
| Slime | SOUND_JUMPENDo (84) | SOUND_JUMPTOCo (85) |
| Plastic | SOUND_JUMPENDk (86) | SOUND_JUMPTOCk (87) |
| Cheese | SOUND_JUMPENDf (88) | SOUND_JUMPTOCf (89) |
| Grass | SOUND_JUMPENDh (90) | SOUND_JUMPTOCh (91) |
Future Audio Work
FREE_EGGBERT_AUDIO_BACKEND=DSOUND|BASS|STUB