@ai-coustics/aic-sdk-wasm 0.23.0, Core SDK 0.23.0. API index · WebAssembly quickstart.
Processor
Processor.free
finally and do not use the handle afterward. Garbage collection does not guarantee timely cleanup; free() does not acknowledge session termination.
Processor.Symbol.dispose
free() when the runtime supports Symbol.dispose; do not call both on the same handle. Otherwise, call free() in finally.
Processor.getProcessorContext
Processor.initialize
sample_rate is a whole-number rate in Hz from 8,000 through 192,000; block_size is a positive whole-number count of mono samples, not bytes. Prefer the model’s optimal sample rate and block size. Unsupported block configurations throw. Pass false for fixed blocks of exactly block_size samples or true to permit shorter blocks up to that maximum. Variable blocks can add buffering delay. Initialization allocates memory and resets signal state. A failed initialization leaves processing uninitialized; correct the configuration before submitting audio again.
Processor.constructor
model and the credential in license_key. For browser applications, pass a short-lived JWT supplied by your backend. Enhancement and bypass model types are accepted; dedicated VAD and analysis models are rejected. The constructor can throw for model creation, model type or credential errors. It does not initialize the audio format. No OpenTelemetry configuration argument is exposed.
Processor.process
Float32Array. Returns void. The generated binding copies input into WebAssembly memory and copies processed values back; this is not zero-copy processing. Requires successful initialization and the configured block length. Throws for mismatched audio, disallowed processing or runtime failures. Do not rely on the input remaining unchanged if processing throws.
Processor.terminateSession
void return is not an acknowledgment of server delivery or immediate completion. This method neither flushes delayed audio nor frees the object. Call free() separately when finished.
ProcessorContext
Processor.getProcessorContext. Its constructor is private. Each returned context is separately owned and must be freed. Freeing a context does not free the processor. A context can retain control state after the processor is freed, but it does not keep an active processing stream alive.
ProcessorContext.free
finally and do not use the handle afterward. Garbage collection does not guarantee timely cleanup; free() does not acknowledge session termination.
ProcessorContext.Symbol.dispose
free() when the runtime supports Symbol.dispose; do not call both on the same handle. Otherwise, call free() in finally.
ProcessorContext.getAudioDelay
ProcessorContext.getParameter
ProcessorParameter. Bypass reads as 0 or 1; enhancement level is a normalized floating-point value.
ProcessorContext.reset
ProcessorContext.setParameter
0 through 1; out-of-range values and NaN throw RangeError. Changes affect subsequent processing. See ProcessorParameter below for defaults and interpretation.
ProcessorContext.updateBearerToken
void, not a network-completion promise.
ProcessorParameter
ProcessorContext.getParameter and setParameter.
ProcessorParameter.Bypass
0 disables bypass; any accepted value greater than 0 enables bypass and reads back as 1. Default: 0. Bypass preserves the configured processing delay.
ProcessorParameter.EnhancementLevel
0 through 1. 0 is dry output and 1 uses the model’s maximum enhancement. The initial value is the model’s default, falling back to 1 when absent.
Process one block
This helper assumes module initialization has completed,model is a live enhancement model, token is a backend-issued JWT and audio contains exactly one optimal block of mono samples. It copies the caller’s block before enhancement, then returns the enhanced block and delay. For a stream, retain the processor across blocks instead of creating it for each call.