Skip to main content
Version: Next


The Manager class acts as the entrypoint for the WebSDK. It will setup a provided AudioContext and create a Renderer instance within that context.

It is manually instantiated as follows:

import { Manager } from "@atmokytalk/websdk"
let manager = new Manager();

Public Interface


version: {major: number; minor: number; patch: number;}

Hold the version of the WebSDK's backend.


This property is only available after prepareContext has been called and its promise has been resolved.


prepareContext(context: AudioContext): Promise<void>

Prepares a provided AudioContext and injects the rendering engine dependencies. Returns a Promise which resolves once the context has been successfully prepared.


Once the promise has resolved, the version property will hold the backend version.

Example: Setup AudioContext
let AudioContext = window.AudioContext || window.webkitAudioContext;
let context = new AudioContext();
manager.prepareContext(context).then(() => {
console.log("Context successfully prepared.");
// create renderer
// ...

createRenderer(numberOfSources: number, numberOfAttenuationCurves: number): Renderer

Instantiates the Renderer with a desired number of input sources and attenuation curves, and returns the instance.


The provided numberOfSources argument will define the maximum number of sources the renderer will be able to spatialize simultaneously. It will allocate enough memory beforehand so it doesn't need to allocate during audio processing (which might cause glitches).

Also note, only actively used source slots will affect CPU usage, stale sources only require a small amount of memory.

The attenuation curves will be stored within the renderer and can be assigned to individual sources.

Example: Instantiate and connect to context's destination
const NUM_SOURCES = 5;
let renderer = manager.createRenderer(NUM_SOURCES, NUM_ATTENUATION_CURVES);
// connect renderer output to the AudioContext's audio sink
renderer.connect(context.destination, 0, 0);