Overview
What is zvuk?
An audio engine for the web. Tiny, ESM, type-safe. Built from a real shipping slot-game stack.
zvuk is a Web Audio API library that hands you the vocabulary you'd expect from Wwise, FMOD, or Unreal: an Engine you talk to, a Mixer made of named Buses, Sounds that spawn Voices, Snapshots that crossfade your whole mix, and Parameters that drive any value with smooth ramps.
Designed around the realities the Web Audio API doesn't smooth over:
autoplay restrictions, iOS Safari's quirky AudioContext lifecycle,
click-free parameter changes, polyphony at scale, and the discipline of disposing
everything you constructed. The library makes those concerns explicit and named, so
your application code can stay short.
What's in v0.0.1
- Runtime: lazy AudioContext, sample-accurate scheduler, decode cache, codec ladder.
- Mixer: Master with headroom, named Buses with click-free fades, FX chain inserts.
- Sources: Sound + Voice with jitter, fades, abort signals, lifecycle promises;
createSoundfor procedural buffers. - Concurrency: per-bus voice limit with steal strategies (
oldest/lowest-priority/quietest/none). - FX: Compressor, Reverb (synthetic IR or your own), Filter (six biquad types), Ducker (sidechain), and a granular pitch-preserving StretchProcessor.
- Spatializer: 2D StereoPanner + 3D HRTF PannerNode per voice.
- Parameters & Snapshots: named knobs with
bindTomapping; whole-mix capture and crossfade.
What's coming
- Realtime time-stretch via AudioWorklet (current StretchProcessor is offline-only)
- Bank manifest loader +
npx zvuk genfor typed sound names - Audio sprites — multi-region atlases in one buffer
- Stream source —
<audio>wrapper for very long music files - React + Vue adapter packages (
useSound,useBus,useParameter)
Read next
- Quickstart — two functions, sound playing.
- The Engine — lifecycle, unlock, state machine.
- Asset formats — the encoding pipeline you should be using.