Skip to content

0.24.0

Choose a tag to compare

@github-actions github-actions released this 08 Sep 09:17
· 4 commits to main since this release
6bc27a0

This release migrates the Node.js binding from Neon to
napi-rs and updates the underlying ai-coustics SDK to 0.24.0.
Both implementations use the aic-sdk Rust crate. The handwritten JavaScript API wrapper
is replaced by napi-rs bindings, with TypeScript declarations generated from the Rust API.

The release adds asynchronous processing and explicit resource cleanup, and includes
breaking API changes for existing integrations.

Breaking Changes

Model downloads are asynchronous

Model.download() now returns a promise instead of a path directly. Await the download
before loading a model:

const modelPath = await Model.download('quail-vf-2.2-s-16khz', './models')
const model = new Model(modelPath)

Collection and analysis use a single Analyzer

new Analyzer(model, key) replaces analyzerPair(model, key). Initialize and buffer audio
on the analyzer itself, and replace analyzeBuffered() with analyze() or analyzeAsync().
Both analysis methods operate on previously buffered audio; neither takes an audio argument.

0.23.x 0.24.0
const { collector, analyzer } = analyzerPair(model, key) const analyzer = new Analyzer(model, key)
collector.initialize(rate, size, variable) analyzer.initialize(rate, size, variable)
collector.buffer(audio) analyzer.buffer(audio)
analyzer.analyzeBuffered() analyzer.analyze() or await analyzer.analyzeAsync()

FileAnalyzer is no longer available. Applications that used it must manage audio windows
with Analyzer, including any reset or padding logic needed for their input. Each call to
analyze() or analyzeAsync() returns one result, not an array of windowed results.

OpenTelemetry configuration is a plain object

OtelConfig is now a TypeScript interface, not a runtime class. Pass a configuration object
as the optional third argument to a processor or VAD constructor:

0.23.x 0.24.0
OtelConfig.enabled() { enable: true }
OtelConfig.disabled() { enable: false }
OtelConfig.withSessionId(id) { enable: true, sessionId: id }
new OtelConfig(enable, id, interval) { enable, sessionId: id, exportIntervalMs: interval }

VAD probability accessor renamed

Replace VadContext.rawVadProbability() with VadContext.getRawVadProbability().

Added

  • TypeScript support. The package now ships generated index.d.ts declarations and API
    documentation for editor autocomplete and type checking. Previous releases provided JSDoc
    but did not ship TypeScript declarations.

  • Asynchronous enhancement and VAD. New ProcessorAsync and VadAsync classes run
    operations such as initialization and processing on Node's libuv thread pool. Existing
    Processor and Vad classes remain synchronous. Await operations in order for each
    instance, and use a separate instance for each audio stream.
    ProcessorAsync.process() returns enhanced samples without modifying the input array;
    VadAsync.process() returns a copy of the input samples, with detection state available
    through its context. Constructors, dispose(), and context methods remain synchronous.

  • Asynchronous analysis. Analyzer.analyzeAsync() runs analysis off the event loop.
    Audio collection through Analyzer.buffer() remains synchronous and can continue while
    analysis is in progress.

  • Explicit resource cleanup. Model, Processor, ProcessorAsync, Vad, VadAsync,
    and Analyzer now expose dispose() to release their native resources without waiting
    for garbage collection. Repeated disposal is safe; subsequent operations on the disposed
    object throw or reject. Disposal is synchronous and can wait for work already using the
    resource; queued work may reject if disposal happens first.
    Disposing a Model releases its reference to the model data. Processors, VADs, and
    analyzers already created from that model retain their own references and keep working.

  • Native memory accounting. Estimated native allocations are now reported to V8 so its
    garbage collector can account for memory held outside the JavaScript heap.

  • SDK-internal error reporting. The SDK reports its own backend failures to ai-coustics error
    tracking. Covered are failed session activations, failed usage reports, and bearer token refreshes
    rejected by ProcessorContext.updateBearerToken, VadContext.updateBearerToken or
    Analyzer.updateBearerToken.

    A report contains the error class and message, the SDK version and wrapper, the model ID, the
    operating system, the CPU architecture, and the account the license was issued to. It contains no
    audio, no license key and no bearer token.

    Disable reporting with DO_NOT_TRACK=1. The variable is read once per process. Licenses with an
    offline entitlement never report.

Changed

  • ProcessorParameter and VadParameter now have generated TypeScript const enum
    declarations. Their existing member names and numeric values are unchanged.
  • The package now declares Node.js 18 or later as its supported runtime.