@ai-coustics/aic-sdk-wasm 0.23.0, Core SDK 0.23.0. API index · WebAssembly quickstart.
Analyzer
Analyzer.free
finally and do not use the handle afterward. Garbage collection does not guarantee timely cleanup; free() does not acknowledge session termination.
Analyzer.Symbol.dispose
free() when the runtime supports Symbol.dispose; do not call both on the same handle. Otherwise, call free() in finally.
Analyzer.analyze
AnalysisResult. It blocks the calling JavaScript thread. Short or empty histories are zero-padded; a successful result does not establish that enough real audio was collected. This method reads a snapshot and does not consume or clear the buffered history. Throws for disallowed processing or native analysis failure. Free each returned result after copying its values.
Analyzer.buffer
Float32Array samples without modifying the caller’s array. The binding copies samples into WebAssembly memory. This call does not run analysis inference. Requires successful initialization and the configured block length; invalid input throws. The collector retains only the newest model window.
Analyzer.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.
Analyzer.constructor
model and the credential in license_key. Use a backend-issued short-lived JWT in browsers. An enhancement or VAD model cannot be analyzed through this interface. Construction can throw for model type, runtime creation or credential errors. No OpenTelemetry configuration or analysis-window argument is exposed.
Analyzer.reset
buffer call while preserving the initialized audio format. Until that call applies the reset, analyze() uses a zero-filled snapshot instead of the previously buffered audio.
Analyzer.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.
Analyzer.updateBearerToken
void, not a network-completion promise.
AnalysisResult
Analyzer.analyze, with seven read-only numeric properties. Its constructor is private. Read the values into ordinary JavaScript data before freeing the result. It is not a plain JavaScript record and spreading it does not copy these prototype getters.
AnalysisResult.free
finally and do not use the handle afterward. Garbage collection does not guarantee timely cleanup; free() does not acknowledge session termination.
AnalysisResult.Symbol.dispose
free() when the runtime supports Symbol.dispose; do not call both on the same handle. Otherwise, call free() in finally.
AnalysisResult.codecDegradation
AnalysisResult.interferingSpeech
AnalysisResult.noise
AnalysisResult.packetLoss
AnalysisResult.riskScore
AnalysisResult.speakerLoudness
AnalysisResult.speakerReverb
Copy and release a result
This helper assumes initialization has completed,model is a live analysis model and token is a backend-issued JWT. Supply mono audio at the model’s optimal sample rate with a length divisible by its optimal block size. It buffers the supplied audio and returns ordinary JavaScript numbers, freeing the WebAssembly result afterward. Supply enough real audio for the model’s window; shorter input is padded with zeros. Buffering a long recording synchronously blocks the event loop, so run that work in an appropriate worker.