Had a little downtime, so made a little engine sound experiment using Web Audio API.
7 Oscillators, a wave shaper, and two filters.
Still playing with it, but I think it sounds pretty neat.
The things I do to procrastinate working on actual projects...

I only played with this for maybe 10 minutes or so. So if I took more time, I could probably get it to sound better. It definitely needs more sculpting. But a lot of it is quite configurable. Maybe I'll drop it somewhere if people want to mess with it.

There's still some issues. For example I'm pretty sure something with my distortion calculations is slightly off, because it crackles quite a bit when it changes. But adding or removing harmonics is pretty easy, and setting the harmonic multipliers is too, so you can get quite a variety out of it. Maybe a convolver or something to get it to sound better as well, it sounds very dry and unrealistic without it. If I'm bored I might add all that.

And it's not much code at all. Maybe about 160 lines? This is why I love the web audio API. Seriously. It is epic. It has no right being this good, and I'm really not sure why it's in a browser. But I'm not complaining.

Do we have a web audio API equivalent but not for the browser? And I do mean both equally powerful but also easy to use?

Follow

@talon I think Open AL is the gold standard and informed some of the web audio api IIRC

@mauve right. But OpenAl still requires you to do most of the legwork yourself. Loading, decoding/synthesizing, etc. All it does is actually play samples you feed it, and position them in 3D. Also it only does 3D, not simple stereo panning. So it's close, but not it.

@talon Hmm yeah you might need to do something more drastic like exrract it from the chromium source tree

Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.