Open-source drop-in replacement for the Miles Sound System (MSS) DLL
OpenMiles is a clean-room reimplementation of the Miles Sound System (MSS) 6.6 API in Zig, designed as a drop-in mss32.dll replacement for legacy Windows games running on modern systems and under Wine.
It replaces the proprietary MSS audio stack with miniaudio for audio output, TinySoundFont for MIDI synthesis, and native decoders for MP3, OGG, and WAV (replacing MSS's proprietary ASI plugins), plus FLAC as a bonus format not in the original MSS.
- Drop-in binary compatible -- exports the same stdcall ABI as
mss32.dll - Digital audio -- sample playback, streaming, volume/pan/pitch/loop control
- MIDI/XMIDI -- real-time synthesis via SF2 soundfonts, tempo control, beat callbacks, XMIDI loop/branch support
- 3D positional audio -- full spatial audio with distance attenuation, Doppler, cones, obstruction/occlusion
- ASI codec system -- built-in MP3/OGG/WAV/FLAC decoding; also loads external
.asiplugins as fallback - RIB provider system -- full provider enumeration and interface registration
- Filter API -- real-time low-pass filtering via miniaudio DSP nodes
- Reverb -- per-sample delay-based reverb
- Timer API -- background timer threads with configurable frequency
- Quick API -- high-level one-call playback
- Perceptual volume curve -- cubic attenuation matching the original MSS ~60dB dynamic range
Requires Zig 0.15.2.
# Native build (Linux/Windows -- for tests)
zig build
zig build test
# Cross-compile for Windows (game deployment)
zig build -Dtarget=x86-windows -Doptimize=ReleaseSmallNote: Native builds on macOS aarch64 (Apple Silicon) are not supported because Zig's stage2 backend does not implement the
aarch64_aapcs_wincalling convention used by the stdcall exports. Use Linux or Windows for native builds, or cross-compile tox86-windows.
The output DLL is at zig-out/bin/mss32.dll.
- Build the Windows DLL with
zig build -Dtarget=x86-windows -Doptimize=ReleaseSmall - Back up the original
mss32.dll/MSS32.DLLin your game directory - Copy
zig-out/bin/mss32.dllto the game directory (as bothmss32.dllandMSS32.DLLon case-sensitive filesystems) - Run the game (natively on Windows, or via Wine on Linux/macOS)
Set OPENMILES_DEBUG=1 in your environment to enable verbose logging to openmiles.log in the game directory.
OPENMILES_DEBUG=1 wine YourGame.exegraph TD
Game["Game (.exe)"] --> DLL["mss32.dll (OpenMiles)"]
subgraph OpenMiles
DLL --> API["src/api/<br/>C ABI exports (stdcall)"]
DLL --> Engine["src/engine/<br/>Zig engine layer<br/>Sample, Sequence, DigitalDriver, Filter"]
DLL --> RIB["src/rib/<br/>RIB provider system"]
DLL --> Utils["src/utils/<br/>Logging, filesystem compat"]
DLL --> Bindings["src/bindings/<br/>C implementations<br/>(AIL_debug_printf, AIL_sprintf)"]
end
Engine --> MA["miniaudio.h<br/>Audio output, decoding, mixing, 3D"]
Engine --> TSF["tsf.h<br/>SoundFont (SF2) synthesis"]
Engine --> TML["tml.h<br/>MIDI file parsing"]
MA --> Backend["WASAPI / PulseAudio / CoreAudio"]
367 functions exported, covering the full MSS 6.6 API surface (legacy waveOut/midiOut compatibility included; DIG_/MDI_ prefix aliases not yet exported). See docs/API_STATUS.md for the per-function implementation matrix.
| Category | Status |
|---|---|
| Core System | Mostly implemented (some Windows/hardware-specific APIs are no-ops) |
| Digital Audio (Samples & Streams) | Fully implemented |
| MIDI / XMIDI | Core playback fully implemented; DLS utility and filter functions stubbed |
| 3D Positional Audio | Fully implemented |
| RIB / ASI Plugin System | Fully implemented |
| Filter API | Low-pass filter implemented |
| Timer API | Fully implemented |
| Quick API | Fully implemented |
| Redbook (CD) API | Emulated (no audio -- games proceed gracefully) |
| Game | Status |
|---|---|
| Europa 1400: The Guild (Gold Edition) | Working -- MP3 streaming, WAV SFX, multiple drivers |
- API Implementation Status -- per-function status matrix
- API Support Matrix -- version compatibility overview
- Plugin & Codec Coverage -- ASI/M3D/FLT replacement status
- MSS Version History -- historical MSS releases
All dependencies are vendored single-header C libraries in deps/:
| Library | Version | License | Purpose |
|---|---|---|---|
| miniaudio | v0.11.25 | MIT-0 / Public Domain | Audio output, decoding, mixing, 3D |
| TinySoundFont | v0.9 | MIT | SF2 synthesis |
| TinyMidiLoader | v0.7 | Zlib | MIDI parsing |
This project is licensed under the GNU General Public License v3.0.
OpenMiles is a clean-room reimplementation. It does not contain any code from the original Miles Sound System by RAD Game Tools.