Add-on

game-toolkit-dosaudio

DOS-era PC sound devices on a shared hardware timeline.

v0.1.1 EUPL-1.2 OR MIT OR Apache-2.0

PC speaker, AdLib OPL2, dual OPL2 and OPL3 behind their real I/O ports, sharing one hardware clock with dosvideo. Interchangeable OPL cores, IMF and DRO playback, register capture and deterministic WAV rendering. The audio thread synthesizes without allocating or locking.

Cargo.toml
[dependencies]
game-toolkit-dosaudio = "0.1"

Features

What it does.

Port-level hardware

Detect the AdLib the way 1990 did: start an OPL timer through 388h, wait, read the status back.

One clock, two halves

The game thread owns timers, latches and port reads; the audio thread owns synthesis. A bounded queue of timestamped changes joins them.

IMF and DRO

Play the formats DOS games and DOSBox captures used, looped or once, on OPL2, dual OPL2 or OPL3.

Offline, deterministic

Render to WAV without an audio device, sample for sample the same as live playback.

Code

What it looks like.

example.rs
use game_toolkit_dosaudio::prelude::*;
use std::time::Duration;

let mut machine = OfflineMachine::new(SoundConfig::none().speaker(true), 48_000)?;
machine.sound(440.0)?;
machine.render_for(Duration::from_millis(100))?;
machine.nosound()?;
machine.render_for(Duration::from_millis(20))?;
std::fs::write("beep.wav", machine.finish().to_bytes()?)?;

More

The rest of the family.