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
https://ghtomcat.github.io/opensim/Been 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
6
u/dronmore Apr 05 '26
The browser's back button kicked me out of the page. So now I'm outside, and will never come back, because that's unacceptable to me.
4
u/dylantestaccount Apr 06 '26
Have you been building this, or prompting it to be built?
I don't think it's a problem to use AI tools as a developer, but it feels a bit disengenous to claim that you built something while it's quite obviously vibe coded.
Even worse, having a post written entirely by AI and then posting back AI-written changelogs based on user given feedback.
2
u/AutoModerator Apr 05 '26
Project Page (?): https://github.com/ghtomcat/opensim
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/[deleted] Apr 08 '26
[removed] — view removed comment