Multi-instance support - Run multiple independent NAM models simultaneously
Optimized for AudioWorklets - Minimal API designed for real-time audio processing
TypeScript support - Full type definitions included
Small footprint - ~200KB WASM binary
Installation
npminstall @opendaw/nam-wasm
Usage
Basic Usage with TypeScript Wrapper
import{ createNamModule, NamWasmModule }from"@opendaw/nam-wasm"// Initialize the moduleconst emscriptenModule =awaitcreateNamModule()const nam = NamWasmModule.fromModule(emscriptenModule)// Set the sample rate (must match your AudioContext)
nam.setSampleRate(48000)// Create an instance and load a modelconst instanceId = nam.createInstance()const modelJson =awaitfetch("model.nam").then(r => r.text())const success = nam.loadModel(instanceId, modelJson)// Process audio (in your AudioWorklet's process method)
nam.process(instanceId, inputBuffer, outputBuffer)// Clean up when done
nam.destroyInstance(instanceId)
nam.dispose()
# Clone with submodulesgit clone --recursive https://github.com/andremichelle/nam-wasm.git
cd nam-wasm
# Or init submodules if already clonedgit submodule update --init--recursive# Install dependenciesnpminstall# Build WASM and TypeScriptnpm run build
# Or build separatelynpm run build:wasm # Build WASM onlynpm run build:ts # Build TypeScript only
Output files are in dist/:
nam.wasm - WebAssembly binary (~200KB)
nam.js - Emscripten ES6 module wrapper
index.js / index.d.ts - Package exports
NamWasmModule.js / NamWasmModule.d.ts - TypeScript API
Performance
Model Type
CPU Usage*
Quality
Standard
~8%
Full fidelity
Lite
~5-6%
Nearly indistinguishable
Feather
~4-5%
Great for live/mixing
Nano
~3%
Some loss in detail
*Per instance on i7 @ 4.2GHz
With Lite/Feather models, 6-8 simultaneous instances run comfortably.
License
MIT License
Third-Party Licenses
Neural Amp Modeler Core
Copyright 2023-2025 Steven Atkinson
MIT License
https://github.com/sdatkinson/NeuralAmpModelerCore
Neural Amp Modeler WASM (original port)
Copyright 2023 Steven Atkinson
MIT License
https://github.com/tone-3000/neural-amp-modeler-wasm