aic_sdk_wasm.d.ts type declarations. Use the compatibility matrix when selecting models and upgrading.
The package also exports dedicated
Vad and Analyzer APIs. Feed VAD the original input; do not infer that another binding’s async or telemetry configuration API exists in WASM. An enhancement processor can also report speech through getEnergyVadContext(), without a second model. See authentication and streams and state.
Installation
Use@ai-coustics/aic-sdk-wasm 0.25.0, Node.js 22 or later for the local token server and a browser with WebAssembly SIMD support. This example processes a local recording into a mono WAV; it does not use an AudioWorklet or microphone pipeline.
Download the noisy speech fixture, or use a short recording you have permission to process, exported as mono PCM16 WAV at 16 kHz. The example accepts up to 60 seconds. Create an SDK key in the developer platform and put it in the server’s AIC_SDK_LICENSE environment variable. Do not put the key into HTML, browser storage or client configuration.
Quickstart
Create the local token server
Save the following asserver.mjs. This server binds to loopback and serves only the listed files. The token endpoint checks the request origin and returns no cached credentials. It decodes the SDK key on the server using the documented token flow.
server.mjs
Create the browser page
Save this asindex.html beside server.mjs. Audio stays in browser memory. The page loads the WASM module and model, requests a token, processes complete frames, pads the tail and removes the reported delay before creating the output file. Session authorization and usage reporting still require network access.
index.html
Run and check the result
http://127.0.0.1:4173, select your recording and choose Enhance. On success, the page displays the number of processed samples and SDK version and exposes Download enhanced.wav. The output has the same sample count as the input, one channel and a 16 kHz sample rate. Compare both files to evaluate quality for your task.
Each recording uses a fresh token with at least two minutes of remaining validity. Processing stops after one minute of wall time. These are demo bounds, not SDK limits. Stop the server with Ctrl+C, then run unset AIC_SDK_LICENSE.
Recover from an error
Adapt this example
Use one processor per independent audio stream.Processor.process() mutates its Float32Array in place and runs synchronously. Move sustained processing off the main UI thread and design buffering around the audio format and latency contracts.
For a long-running stream, refresh a JWT through your authenticated backend before expiry and update the existing context: