I’ve been on a ridiculous JavaScript kick lately.
I’ve gone so far as to completely ditch any C#-based project I was focusing on, and either re-writing it in JavaScript or ignoring said project completely.
But, if you know anything about games, audio, and programming languages – this is probably a little weird.
(If you don’t – here’s why – nothing game related except for browser games uses JavaScript and audio)
If you’re using Unity – most of your work will be done in C#.
If you’re using Unreal – most of your work will be done in either Blueprints or C++.
If you’re using middleware – event-related code is generally written in the engine’s native language (again, C# or C++)
Beyond this, most game companies use Phython or Lua for scripting and little ease-of-life tools.
There are only two things I know that utilize JavaScript in regard to anything serious that’s game and audio related – FMOD scripting, and the Wwise Authoring API. That’s it.
So why the hell would I ditch everything to soak my mind in Javascript for a few months?
A Few Facts
JavaScript has been the #1 language on GitHub for at least 4 years running. Depending on where you get your information from, almost 1/4 of GitHub users have created JavaScript-based repositories.
Considering there are literally tens of millions of users on GitHub – that should be… pretty startling to you.
Now, I know – I know – there’s plenty of caveats to this number. GitHub’s numbers are likely skewed in some form or fashion, and additionally – web-based programming is hands down the most popular form of programming that exists. That’s true by a long shot.
It should be fairly obvious why – plenty of your day is spent with a browser window open.
Additionally, a large chunk of the apps on your phone aren’t actually “native” apps at all – they’re web pages posing as apps!
“Okay Adam – that’s interesting – but what relation does this have to games and audio at all?”
Well… it’s funny you should ask that.
Depending on what middleware you’re using – you could already be using JavaScript every day.
If you’ve ever opened up the Wwise Launcher, for example, you’re using something written in JavaScript.
(FMOD may also have a chunk of JavaScript code – especially because their scripting interface is 100% JavaScript – I just haven’t dug in enough to know)
The Wwise Launcher was made possible by a framework called Electron. It was built by GitHub 5 years ago, and has since become ubiquitous in its popularity. I can almost guarantee you’re using an Electron-based app on at least a weekly basis today. The desktop apps for Slack, Discord, Visual Studio Code, Skype, Atom, and Twitch all use it.
So, again, why does this matter at all?
Well – creating a “native” desktop application that works cross-platform (both Mac & PC) is now only a little bit more complicated than making a web page.
Seriously.
So I’m here to argue the following point –
This sudden usage of JavaScript in your audio life is only going to increase – and very few realize it yet.
The Coming Wave
Electron (and similar frameworks) are making it stupid simple to make desktop applications now.
In layman’s terms – the way this works is your “app” is a stripped-down version of a browser window (in Electron’s case it’s Chromium). What it’s displaying to you visually is literally an HTML page loaded in a web browser. This can communicate to JavaScript files whenever you make an action in the UI, and said JavaScript is using Node.js – so it has filesystem access.
Pretty neat, right?
So if you’ve ever wanted to make an app, a tool, a music player, whatever – if you know how to make a website, you can definitely learn how to make your own application.
Even better – because FMOD and Wwise provide JavaScript-based APIs allowing you to automate their respective GUIs/Authoring Tools – you can make your own custom applications that hook directly into your game audio middleware.
Most ridiculously crazy is a concept commonly called “interop” in programming-world. This is where you can cause “interoperability” between two different languages. So, getting C# and C++ to talk to each other. Or, say, JavaScript and C++/C#.
Now, this isn’t so easy that someone who has never written code before can just quickly pick it up – but it is possible. Plenty of professional programmers would also take the opportunity to inform me that it’s not effective use of resources – and yeah, sure.
But, effectively what this means is that if you want to make any audio-related application, the guts of it can live in C++. You can then spin up an extremely quick, easy, and simple UI with JavaScript.
That, to me, is mind boggling. Yes – I’m sure there’s 18 million hitches with it. I’m not positive we’re going to end up with a browser-based DAW UI that runs off a C++ audio engine binary in the super near future. But, the fact that’s even remotely possible is crazy to me.
It’s my opinion that we’re only going to be seeing more things like this – JavaScript seems to be fairly clearly owning the world due to its ubiquitous use on the web. As even our audio applications become more connected – it makes sense that you’re going to see more and more audio-related applications using JavaScript.
Which – as far as you care – means jobs, and another way to make yourself unique and helpful.
I’m positive plenty of you have never thought about doing web-based audio for Facebook, Google, etc. Even Audiokinetic is getting in on the action regarding real-world interactivity with automobiles.
So, open your minds my friends – there’s a lot of tremendously interesting interactive audio applications coming down the pipeline in the future. It seems like very few people see it coming – but I’m encouraging you to jump on the train (with, or without code!)
If you’re curious for even more information, here’s some links to check out (JavaScript related, and not!)
Copyright 2016-2021, NIR LLC, all rights reserved.