Code Self Study Forum

High Performance Web Audio with AudioWorklet in Firefox

Now developers can leverage AudioWorklet to write arbitrary audio processing code, enabling the creation of web apps that weren’t possible before. This exciting new functionality raises the bar for emerging web experiences like 3D games, VR, and music production.

Audio worklets bring power and flexibility to general purpose real-time audio synthesis and processing. This begins with the addModule() method to specify a script that can generate audio on the fly or perform arbitrary processing of audio. Various kinds of sources can now be connected through the Web Audio API to an AudioWorkletNode for immediate processing. Source examples include an HTMLMediaElement resource, a local microphone, or remote audio. Alternatively, the AudioWorklet script itself can be the source of audio.

…The audio processing code runs on a dedicated real-time system thread for audio processing. This frees the audio from pauses that in the past might have been caused by all the other things happening in the browser.