Installation
Install with NativeScript CLI:
bash
ns plugin add @nativescript/audio-contextOr install with npm:
bash
npm install @nativescript/audio-contextRequirements
@nativescript/audio-context2.x requires NativeScript 9.1 or later. Pair it with@nativescript/canvas3.x if you use both packages.- Supported platforms: iOS, tvOS, visionOS, Android, Windows and Linux. The tvOS simulator build is arm64 only, so use an Apple silicon Mac to run it in the simulator.
- On Windows and Linux the graph is rendered by the web-audio-api engine, playing through WASAPI on Windows and ALSA on Linux (PulseAudio and PipeWire work through their ALSA plugins).
decodeAudioDatareads WAV, MP3, Ogg Vorbis, FLAC and AAC. AWaveShaperNodetakes only one curve: assigning a second throwsInvalidStateError.
Verify setup
Create a context and log the initial state:
ts
import { AudioContext } from '@nativescript/audio-context';
const ctx = new AudioContext();
console.log(ctx.state);Recommended next step
After installation, continue with Quick Start to create your first signal chain.