Audio
Sound system: channels, assets, and playback.
Overview
Audio is handled by the SoundManager class
(src/GalaxyEggbert/Game/SoundManager.hpp/.cpp).
It wraps the Urho3D audio subsystem and provides 93 named sound channels matching the original game's sound table.
Sound Assets
93 WAV files are stored in Content/sounds/:
sound000.wav … sound092.wav.
The file indices map directly to SoundChannel enum values.
These are the same WAV files as the original Speedy Blupi game.
SoundChannel Enum
Defined in include/GalaxyEggbert/def/SoundChannel.hpp.
Values range from SoundChannel0 (reserved) to SoundChannel92.
Do not renumber — indices must match the original game's sound table.
Wired Sound Events
| SoundChannel | File | Event |
|---|---|---|
SoundChannel1 | sound001.wav | Blupi jumps |
SoundChannel4 | sound004.wav | Blupi lands on ground |
SoundChannel8 | sound008.wav | Blupi hit (by enemy or hazard tile) |
SoundChannel10 | sound010.wav | Treasure collected |
SoundChannel11 | sound011.wav | Key collected |
SoundChannel42 | sound042.wav | Shield collected / bonus life awarded |
SoundChannel57 | sound057.wav | Level exit reached (win) |
Playback Behavior
- Same-channel conflict policy: a playing channel is not restarted, except
SoundChannel10(treasure pickup). - Volume per channel is taken from the
tableVolumePitchtable ported from mobile-eggbert. Needs verification: exact volume values are inSoundManager.cpp. - When sound is disabled (
SoundManager::SetEnabled(false)),Play()is a no-op and all channels are stopped. - Sound can be toggled from the settings screen (S key) and is persisted in the save file.
API
class SoundManager {
void Play(SoundChannel channel, bool loop = false);
void Stop(SoundChannel channel);
void StopAll();
void SetEnabled(bool enabled);
bool IsEnabled() const;
};
Urho3D Integration
Each channel corresponds to a Urho3D::Sound resource and a Urho3D::SoundSource
component on an audio node in the scene. The SoundManager creates all 93 channels at construction
by loading resources from the cache.
Web / Browser Audio
Browsers require a user gesture before audio starts. If no sound is heard in the Web build, click the canvas once. This is a browser security policy, not a bug in Galaxy Eggbert.