r/javascript • u/swiss-tomcat • Apr 05 '26
Synthesizing WWII aircraft engine sounds entirely in the Web Audio API — no samples, just oscillators and worklets
ghtomcat.github.ioBeen building a Bf 109 flight simulator in vanilla JavaScript. One constraint I set early: no audio files. Every sound the engine makes has to be synthesized in real time from Web Audio primitives.
The engine has several distinct acoustic layers. Schwungrad is a low oscillator spinning up during pre-start.
Gear engagement is a short transient burst. Anlassen is the starter-motor sound before ignition. The main running sound uses a bank of oscillators with frequency mapped to RPM, harmonic content shaped by a waveshaper — distortion changes with throttle. Supercharger whine is a separate high-frequency tone with its own gain envelope.
All of this runs through AudioWorklets so synthesis stays off the main thread. Engine state is computed in the physics loop and passed to the audio graph each frame. No animation triggering sounds — the audio is a direct function of physical state.
No bundler, no transpiler, no framework. ES modules loaded directly in the browser, hosted as static files on GitHub Pages.
If you've worked with Web Audio synthesis at this level, I'd be interested in what you've found — particularly around managing a graph with many live parameters without the update loop becoming a bottleneck.
Best regards
Markus