Skip to main content

Web

Overview

Running Switchboard audio engines on the web couldn't be easier. We've spend a long time simplifying the steps required to get a fully functional audio engine up and running in your application really easy.

Audio software development is tricky and often results in otherwise proficient and experienced developers drowning in audio domain software concepts, incorrectly wiring audio libraries together in suboptimal patterns.

Using Switchboard on the web requires zero prior knowledge of audio engines, web audio, audio worklets, multiple threads, web assembly or any DSP domain knowledge. We've carefully taken care of all of that for you so you can focus elsewhere when building your applications.

Switchboard audio engines running in Javascript are defined in Switchboard JSON format, which offers a quick and easy way to describe an audio pipeline as a set of node, connections and parameters.

Quick start

The Switchboard SDK for Web allows you to run complexis available on NPM as @synervoz/switchboard-sdk-js and can be loaded just like any other library into your JS project.

First install the Switchboard SDK for Javascript

npm install @synervoz/switchboard-sdk-js

Then in your application, import the SDK as follows

import { WebAudioEngine } from '@synervoz/switchboard-sdk-js'

// Create an instance of anaudio engine
const switchboardAudioEngine = new WebAudioEngine()

// Define audio graph in Switchboard JSON (string format supported too).
const exampleSwitchboardJSON = {
nodes: [
{
id: 'myToneGenerator',
type: 'Switchboard.SineGenerator',
},
],
}

async function startEngine(json) {
// Load the JSON into the audio engine
await switchboardAudioEngine.initialize(switchboardJSON)

// Start the audio playback (usually on a mouse interaction)
switchboardAudioEngine.resume()
}

startEngine(exampleSwitchboardJSON)

It's that simple.

Switchboard Editor JSON design tool

Our online Switchboard Editor here help you to design your Switchboard JSON. We automatically wrap some really useful UI around your Switchboard JSON to tweak parameters while you are developing your audio engine and see whats going on under the hood.

Here's an embedded example of the above graph running in the Audio IDE.

Remember though that when it comes to running Switchboard in your own application, we take care of the audio engine, it's up to you to wrap any UI around it you might need.