Skip to content

Supported API Surface

Main contexts

Core graph primitives

Source and processing nodes

Recent additions include DynamicsCompressorNode for compression workflows and channel routing helpers like ChannelSplitterNode and ChannelMergerNode.

Lifecycle and routing

Web-style factory method parity

ts
import { AudioContext } from '@nativescript/audio-context';

const ctx = new AudioContext();

// Same creation flow web audio developers expect.
const gain = ctx.createGain();
const filter = ctx.createBiquadFilter();
const panner = ctx.createPanner();
const stereo = ctx.createStereoPanner();
const delay = ctx.createDelay();
const analyser = ctx.createAnalyser();
const shaper = ctx.createWaveShaper();
const convolver = ctx.createConvolver();
const compressor = ctx.createDynamicsCompressor();
const split = ctx.createChannelSplitter({ numberOfOutputs: 2 });
const merge = ctx.createChannelMerger({ numberOfInputs: 2 });

const osc = ctx.createOscillator();
const source = ctx.createBufferSource();

osc.connect(filter);
filter.connect(compressor);
compressor.connect(gain);
gain.connect(ctx.destination);

Optional global polyfill integration

If your app also uses @nativescript/canvas-polyfill, browser-like audio globals can be registered for compatibility with libraries that expect them: