What can the C++ that the web audio API can't?

What can the C++ that the web audio API can’t ?

In principle you can do pretty much anything as you could with C++ if you can get access to the raw audio buffers with the WebAudio API. How fast that kind of code runs is another matter, of course. WebAudio and similar systems are not usually meant to be used so that you yourself calculate every audio sample individually. (Instead you are supposed to use ready-made DSP modules/objects and connect them together.)

1 Like

Thanks, I really fell down the web rabbit hole when I wanted something more convenient for prototyping than python and easy to be productive with. Honestly I love the beefiness of using c++, I just got frustrated and needed to take a productive break and learn something new and equally useful.

I personally love the visual aspects of web and hopefully it will transfer better to using the JUCE GUI features having worked with CSS and js in tandem.

Also the api provides raw buffers, whether or not the browser abstraction is a problem I can’t tell you. C++ is of course still the standard.

I spent quite a bit of time on Web Audio. @Xenakios is absolutely correct.

You can do per sample DSP with AudioWorklet or ScriptProcessorNode, but it runs clunky Javascript in a background thread. And is extremely audio dropout prone. You can combine WASM and AudioWorklet (Chrome only), but that’s so bleeding edge the documentation for how to do it is not really that great yet. (I wasn’t able to figure it out). And when I use other people’s Web Audio stuff, I still frequently get dropouts on my system.

But if you want to combine beefiness with ease of production, check Soul or Faust. They even have Web Audio implementations so you can try it right from your browser!

2 Likes

For my purposes at the moment I’m not really looking for per sample processing. There were a couple things I was really struggling to do efficiently with JUCE and was spending more time getting frustrated than work done. Honestly I don’t think there is any time wasted migrating between tech occasionally. I think it kills the monotony, especially since I’ve only got maybe less than a year of really solid C++ knowledge, and two years or so of trying to get comfortable with its idiosyncrasies. I think whatever I can do to keep the programming ball rolling forward is more productive than allowing myself to get too caught up in one technology and just upset.

Well you know, if you just want to play with DSP and don’t want the tech to get in the way… PureData is perfect.

Absolutely, for school, just graduated Audio Technology CS concentration, we used max, and I used Pd for my senior project! It doesn’t lend itself as much to shipping an app, or thinking in GP text based languages, so I would far more inclined to play with supercollider, faust, or soul.

Hmm I disagree to a certain extent … I spent some time with it and was surprised how powerful it is, and how far you can get with it. Not as powerful as in “replace ProTools”, but it’s definitely powerful enough to create tools for creative expression, not just toys.

I managed to get a little Live Coding language running with an AudioWorklet and, in my case, Rust and WASM. There’s several others out there that are quite impressive. You could also compile C++ to WASM if you’re brave.

The difference between browsers is annoying, but I think the latest version of Firefox included the AudioWorklet ? Not 100% sure.

Anyway, if you want to create tools that you can share with people with zero installation effort, the WebAudioAPI is pretty amazing IMHO. It’s basically an extendable modular synth right in your browser, directly connected to a powerful visualization engine.

Here’s a nice example of what it can do:
https://gibber.cc

1 Like

Forgive me, I don’t wish to downplay the significance of it, and quite the achievement it certainly is, and i know ‘the current year’ is not an argument, but here we are with all the computing power of 2020, and for whatever reason, it still can’t be trusted for rock solid playback on your average consumer grade system. Which, to be fair, my opinion is only based on two different laptops with Windows 10 and Lubuntu, (let’s not even get into mobile!) But if it can’t be trusted to perform without pops, no matter how great on paper, it’ll never be more than a toy for me.

P.s. AudioWorklet has arrived in firefox this werk

1 Like

Back when “HTML5”(AKA Kill Flash era) with the shield and web audio started I hoped for clicks and pops to eventually fade into the past, but they are still here. I spent years with crossed fingers, this is probably 2011-2013. We are in 2020 now folks, that was almost 8 years ago! haha

Close to the metal for now seems the only way to get production type algorithms to work real-time. Probably why I am not C++ experienced by now was due to staying on high level languages thinking this stuff was going to work out. Total miss on that one. Back to C++ for me. :slight_smile:

Still can’t wait to see if before I am dead I can make my DAW in the browser. :slight_smile: