Why
Slot games have a lot of sound happening at once: reel spin loops, a stop click per reel, anticipation risers, win jingles that must duck the music, and a big-win stem that switches the whole mix. Most web games either play Audio elements and hope, or pull in a large library that was never built for mixing.
zvuk ("sound" in Russian) borrows the model from game audio middleware and fits it in a budget:
- Named buses with FX inserts, master headroom and a limiter.
- Voice concurrency with voice stealing, so ten simultaneous reel stops don't clip.
- Sprites and variants (shuffle-bag, so the same click doesn't repeat).
- Music stems with intro / loop / outro.
- Snapshots and a sidechain ducker for big-win moments.
- iOS unlock, a codec ladder, a lazy
AudioContext, andAbortSignalcancellation everywhere.
Budgets
.size-limit.json fails CI above 18 kB gzip for the full import or 16 kB for createEngine alone. Benchmarks for decoding, fade drift and voice spawning run in CI. Tests run against a Web Audio mock in happy-dom, plus a conformance suite.
Examples cover a slot machine, a match-3 game and FPS footsteps. zvuk is the audio layer in artubeplate and stakeplate.