decibri 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,32 @@ For other decibri packages, see:
9
9
  - Rust core: [crates/decibri/CHANGELOG.md](../../crates/decibri/CHANGELOG.md)
10
10
  - Python package: [bindings/python/CHANGELOG.md](../../bindings/python/CHANGELOG.md)
11
11
 
12
+ ## [5.5.0] - 2026-08-10
13
+
14
+ ### Breaking changes
15
+
16
+ - **The `RangeError` thrown for a `channels` count below 1 carries the message `channels must be at least 1`.** It carried `channels must be between 1 and 32`, naming an upper bound that neither `Microphone` nor `Speaker` enforces. Code that matches the message text exactly stops matching and has to be updated to the new text. Nothing else about the error moves: it is still a `RangeError`, thrown for the same input, `channels: 0` on either constructor or `open()`.
17
+ - **`Speaker` accepts a `channels` count above 32.** It threw `RangeError: channels must be between 1 and 32` from the constructor. It now accepts any count above zero, offers the count to the device when playback starts, and a device that cannot serve it emits a `DecibriError` with code `SPEAKER_CHANNELS_UNSUPPORTED` on the `'error'` event, or rejects `writeAsync()` with it. Code that relied on the constructor throwing to reject an unsupported output channel count has to handle the failure asynchronously instead, on `'error'` or the rejection. `new Speaker({ channels: 0 })` still throws a `RangeError` from the constructor, and a count above 16383 still carries `STREAM_OPEN_FAILED` naming that limit. How many channels a device serves depends on the `sampleRate` asked for as well as the count.
18
+ - **An output channel count above the device's reported figure carries `SPEAKER_CHANNELS_UNSUPPORTED`.** It carried `STREAM_OPEN_FAILED`. Code branching on `STREAM_OPEN_FAILED` to detect an unsupported output channel count has to match `SPEAKER_CHANNELS_UNSUPPORTED` as well, and cannot drop `STREAM_OPEN_FAILED`, because a device that reports no figure at all keeps `STREAM_OPEN_FAILED` for the same condition. `STREAM_OPEN_FAILED` is otherwise unchanged and remains the code for an output open that failed for any other reason.
19
+ - **The browser `Microphone` rejects a `channels` count above 1.** It accepted 1 to 32 and delivered the first channel only, with nothing to indicate the rest were dropped. A count above 1 now throws `RangeError: multichannel capture is not supported; channels must be 1 (mono)`, and a count below 1 throws `RangeError: channels must be at least 1` where it threw a `TypeError`. Code passing a count above 1 to the browser entry has to pass 1 and mix down its own sources, or read the single channel it was already receiving. `channels: 1` is unchanged, as is every other browser `Microphone` option. Both class and message now match the Node entry's for the same values, so the two entries reject the same input the same way.
20
+ - The browser `Speaker` is unchanged. It still accepts 1 to 32 channels, the range the Web Audio specification requires an implementation to support, and keeps its own `channels must be between 1 and 32, got <n>` message, which that range does enforce.
21
+
22
+ ### Added
23
+
24
+ - Error code `SPEAKER_CHANNELS_UNSUPPORTED` on `DecibriError`, for an output device that cannot serve the requested `channels`. The message names the count asked for, the count the device reports (the figure `SpeakerInfo.maxOutputChannels` carries) and the platform's own message.
25
+ - `referenceChannels` on the `aec` option object: the channel count of the far-end reference pushed through `pushAecReference`. Default 1 (mono). With a count above 1 the pushed samples are read as interleaved frames and each frame is averaged to one mono sample before the canceller sees it. The collapse is opt-in: a caller pushing a multichannel reference must declare the count, and an undeclared multichannel push keeps its current behaviour, cancelling nothing and reporting no error. The declared count must match the pushed buffer: a mismatch is not detected and raises no error, and shows up only as `aecMetrics().delaySamples` staying `null` with no fault reported. A count below 1 throws a `RangeError`; the only ceiling is the option's own 16-bit carrier. A mono reference against playback through more than one loudspeaker has a cancellation ceiling: the canceller models one room response applied to the channel average, so a placement where the per-loudspeaker echo paths differ leaves a residual that adaptation does not remove.
26
+ - Each of the four platform packages (`@decibri/decibri-win32-x64-msvc`, `@decibri/decibri-darwin-arm64`, `@decibri/decibri-linux-x64-gnu`, `@decibri/decibri-linux-arm64-gnu`) now includes `THIRD-PARTY-NOTICES.md`, the third-party license notices for the ONNX Runtime dynamic libraries the package carries and for the third-party material incorporated into them, with a source-availability statement for the MPL-2.0-licensed Eigen code they contain.
27
+ - `models/THIRD-PARTY-NOTICES.md`, carrying the origin, version and license text for the two bundled ONNX models together with the training-data attribution the denoise checkpoint requires. It ships beside the weights it covers. `models/README.md` alongside it documents each model's tensor interface and points at the notice.
28
+
29
+ ### Changed
30
+
31
+ - ONNX Runtime telemetry is disabled on the environment decibri commits when it initializes the runtime, where it was left at ONNX Runtime's own default of enabled. This covers every path that reaches the runtime: `vad: 'silero'` and the ACE `denoise` stage. Set `DECIBRI_ORT_TELEMETRY=1` in the environment before first use to leave it enabled; every other value, an empty value, and an absent variable leave it disabled. Two limits apply on Windows and decibri can close neither. ONNX Runtime logs one process-information event while the environment is being created, before the setting is applied, and logs it once per process, so that event is emitted whichever way the setting is left. The runtime also assigns its telemetry state from the Windows tracing session through an ETW callback, so the platform can re-enable telemetry after decibri has disabled it. On other platforms ONNX Runtime's telemetry provider does nothing. The browser build has no ONNX Runtime and is unaffected. No option, event, method or error text changes.
32
+
33
+ ### Fixed
34
+
35
+ - The bundled Silero VAD model is documented as v6.2, the version that ships. The `model` field on `VadOptions`, the `vad` option on `MicrophoneOptions`, the README and the notice beside the model named v5. Which model file ships is unchanged.
36
+ - The Silero VAD tensor specification in `models/README.md` names the tensors the model exposes: `input`, `state` and `sr` in, `output` and `stateN` out. It described a four-input form carrying separate `h` and `c` LSTM tensors.
37
+
12
38
  ## [5.4.0] - 2026-08-04
13
39
 
14
40
  ### Added
package/README.md CHANGED
@@ -152,7 +152,7 @@ Creates a Writable stream for speaker playback.
152
152
  | Option | Type | Default | Description |
153
153
  | --- | --- | --- | --- |
154
154
  | `sampleRate` | number | 16000 | Playback sample rate (1000 to 384000) |
155
- | `channels` | number | 1 | Output channels (1 to 32) |
155
+ | `channels` | number | 1 | Output channels (1 or more, up to what the device supports) |
156
156
  | `dtype` | `'int16'` \| `'float32'` | `'int16'` | Sample encoding of incoming data |
157
157
  | `device` | number, string, or `{ id: string }` | system default | Output device index, case-insensitive name substring, or stable per-host ID |
158
158
 
@@ -293,7 +293,7 @@ mic.on('silence', () => console.log('silent'));
293
293
 
294
294
  ### Silero mode
295
295
 
296
- ML-based detection using the Silero VAD v5 model. More accurate than energy mode, especially in noisy environments.
296
+ ML-based detection using the Silero VAD v6.2 model. More accurate than energy mode, especially in noisy environments.
297
297
 
298
298
  ```javascript
299
299
  const mic = new Microphone({ vad: { model: 'silero', threshold: 0.5 } });
@@ -337,6 +337,14 @@ setTimeout(() => mic.stop(), 5000);
337
337
 
338
338
  VAD reads the signal before the chain, so `vadScore` and the `'speech'` / `'silence'` events are unaffected by which conditioning stages you enable. The conditioning chain runs in the native Node.js capture path; the browser build does not include it.
339
339
 
340
+ ## ONNX Runtime telemetry
341
+
342
+ Silero mode (`vad: 'silero'`) and the ACE `denoise` stage run on ONNX Runtime, which carries its own telemetry, separate from anything decibri does. Decibri disables it on the environment it commits when it initializes the runtime. Set `DECIBRI_ORT_TELEMETRY=1` in the environment before first use to leave it enabled; every other value, an empty value, and an absent variable leave it disabled.
343
+
344
+ Two limits apply on Windows and decibri can close neither, so decibri does not claim that no telemetry is emitted. ONNX Runtime logs one process-information event while the environment is being created, before the setting is applied, and logs it once per process, so that event is emitted whichever way the setting is left. The runtime also assigns its telemetry state from the Windows tracing session through an ETW callback, so the platform can re-enable telemetry after decibri has disabled it. On other platforms ONNX Runtime's telemetry provider does nothing.
345
+
346
+ Neither ONNX Runtime nor this setting applies to the browser build, which has no ONNX Runtime.
347
+
340
348
  ## API: File (offline source)
341
349
 
342
350
  Everything a `Microphone` does to live audio, `File` does to audio you already have: the same conditioning options, the same Readable stream of conditioned chunks (finite: it ends at EOF), and the same opt-in `vad`. Because a `File` is a complete recording, it can also analyze the whole recording for speech.
@@ -70,7 +70,7 @@ var decibri = (function() {
70
70
  var require_decibri_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
71
71
  const { Emitter } = require_emitter();
72
72
  const { WORKLET_SOURCE } = require_worklet_inline();
73
- const VERSION = "5.4.0";
73
+ const VERSION = "5.5.0";
74
74
  /**
75
75
  * Browser microphone capture.
76
76
  *
@@ -132,6 +132,8 @@ var decibri = (function() {
132
132
  this._noiseSuppression = options.noiseSuppression ?? true;
133
133
  this._workletUrl = options.workletUrl;
134
134
  if (this._sampleRate < 1e3 || this._sampleRate > 384e3) throw new RangeError("sample rate must be between 1000 and 384000");
135
+ if (this._channels < 1) throw new RangeError("channels must be at least 1");
136
+ if (this._channels > 1) throw new RangeError("multichannel capture is not supported; channels must be 1 (mono)");
135
137
  if (this._channels < 1 || this._channels > 32) throw new TypeError(`channels must be between 1 and 32, got ${this._channels}`);
136
138
  if (this._framesPerBuffer < 64 || this._framesPerBuffer > 65536) throw new TypeError(`frames per buffer must be between 64 and 65536, got ${this._framesPerBuffer}`);
137
139
  if (this._dtype !== "int16" && this._dtype !== "float32") throw new TypeError("dtype must be 'int16' or 'float32'");
package/index.d.ts CHANGED
@@ -324,6 +324,17 @@ export interface DecibriOptions {
324
324
  * when `aec` names a model.
325
325
  */
326
326
  aecReferenceSampleRate?: number
327
+ /**
328
+ * Number of channels in the far-end reference pushed through
329
+ * `pushAecReference`, at least 1. Absent means the reference is mono;
330
+ * when it names a count above 1, the core collapses each interleaved
331
+ * frame to one mono sample before the canceller sees it. The declared
332
+ * count must match the pushed buffer: a mismatch is not detected and
333
+ * raises no error, and shows up only as `aecMetrics().delaySamples`
334
+ * staying `null` with no fault reported. Consulted only when `aec`
335
+ * names a model.
336
+ */
337
+ aecReferenceChannels?: number
327
338
  }
328
339
 
329
340
  /** Options passed from JS constructor for output. */
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@decibri/decibri-android-arm64')
79
79
  const bindingPackageVersion = require('@decibri/decibri-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@decibri/decibri-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@decibri/decibri-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@decibri/decibri-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@decibri/decibri-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@decibri/decibri-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@decibri/decibri-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@decibri/decibri-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@decibri/decibri-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@decibri/decibri-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@decibri/decibri-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@decibri/decibri-darwin-universal')
184
184
  const bindingPackageVersion = require('@decibri/decibri-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@decibri/decibri-darwin-x64')
200
200
  const bindingPackageVersion = require('@decibri/decibri-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@decibri/decibri-darwin-arm64')
216
216
  const bindingPackageVersion = require('@decibri/decibri-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@decibri/decibri-freebsd-x64')
236
236
  const bindingPackageVersion = require('@decibri/decibri-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@decibri/decibri-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@decibri/decibri-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@decibri/decibri-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@decibri/decibri-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@decibri/decibri-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@decibri/decibri-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@decibri/decibri-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@decibri/decibri-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@decibri/decibri-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@decibri/decibri-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@decibri/decibri-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@decibri/decibri-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@decibri/decibri-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@decibri/decibri-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@decibri/decibri-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@decibri/decibri-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@decibri/decibri-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@decibri/decibri-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@decibri/decibri-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@decibri/decibri-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@decibri/decibri-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@decibri/decibri-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@decibri/decibri-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@decibri/decibri-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@decibri/decibri-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@decibri/decibri-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@decibri/decibri-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@decibri/decibri-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@decibri/decibri-openharmony-x64')
494
494
  const bindingPackageVersion = require('@decibri/decibri-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@decibri/decibri-openharmony-arm')
510
510
  const bindingPackageVersion = require('@decibri/decibri-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '5.4.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 5.4.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '5.5.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 5.5.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
package/models/README.md CHANGED
@@ -1,66 +1,42 @@
1
1
  # Models
2
2
 
3
3
  This directory holds the third-party model files decibri bundles, together with
4
- the license notices each one requires. These notices ship inside the published
5
- npm and PyPI packages alongside the model weights, so the attribution travels
6
- with the files it covers.
4
+ the tensor interface each one exposes. The license notice every model requires
5
+ is in `THIRD-PARTY-NOTICES.md` beside this file, and ships alongside the weights
6
+ it covers inside the published npm and PyPI packages.
7
7
 
8
8
  ## silero_vad.onnx
9
9
 
10
- - **Name:** Silero VAD v5
11
- - **License:** MIT
12
- - **Source:** https://github.com/snakers4/silero-vad
13
- - **Size:** ~2.2 MB
10
+ - **Model:** Silero VAD v6.2
11
+ - **Source:** https://github.com/snakers4/silero-vad (release `v6.2`)
12
+ - **Size:** ~2.2 MB (2,327,524 bytes)
14
13
  - **Purpose:** Voice Activity Detection. Determines whether an audio frame contains human speech
15
14
 
16
15
  ### Input/Output Specification
17
16
 
17
+ Verified from the model file (ONNX IR version 8, opset 16, exported with spox).
18
+ All tensors are fp32 except `sr`, which is i64. The batch, sample-count and
19
+ state dimensions are declared dynamic; the shapes below are what the model takes
20
+ and produces at batch 1.
21
+
18
22
  **Inputs:**
19
- - `input`: f32[batch, window_size]: audio samples (512 at 16kHz, 256 at 8kHz)
20
- - `sr`: i64[batch]: sample rate
21
- - `h`: f32[2, batch, 64]: LSTM hidden state
22
- - `c`: f32[2, batch, 64]: LSTM cell state
23
+ - `input`: f32[batch, context_size + window_size]: audio samples. Each call is fed the previous window's last `context_size` samples followed by the current window (64 + 512 = 576 at 16 kHz, 32 + 256 = 288 at 8 kHz), where `context_size` is `window_size / 8`.
24
+ - `state`: f32[2, batch, 128]: combined LSTM hidden and cell state
25
+ - `sr`: i64 scalar: sample rate
23
26
 
24
27
  **Outputs:**
25
28
  - `output`: f32[batch, 1]: speech probability (0.0 to 1.0)
26
- - `hn`: f32[2, batch, 64]: updated hidden state
27
- - `cn`: f32[2, batch, 64]: updated cell state
28
-
29
- Note: Exact tensor names may differ. Verified at build time from the model file.
30
-
31
- ### License Notice
32
-
33
- This model is a third-party artifact, not proprietary to decibri. It is
34
- distributed under the MIT License, reproduced in full below.
35
-
36
- ```text
37
- MIT License
29
+ - `stateN`: f32[2, batch, 128]: updated state
38
30
 
39
- Copyright (c) 2020-present Silero Team
40
-
41
- Permission is hereby granted, free of charge, to any person obtaining a copy
42
- of this software and associated documentation files (the "Software"), to deal
43
- in the Software without restriction, including without limitation the rights
44
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45
- copies of the Software, and to permit persons to whom the Software is
46
- furnished to do so, subject to the following conditions:
47
-
48
- The above copyright notice and this permission notice shall be included in all
49
- copies or substantial portions of the Software.
50
-
51
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
57
- SOFTWARE.
58
- ```
31
+ Streaming contract: the model carries no state of its own between calls. Initialize
32
+ `state` to zeros and the audio context to zeros at the start of a stream, feed each
33
+ call's `stateN` back as the next call's `state`, and carry the last `context_size`
34
+ samples of each window forward as the next call's context. Feeding a bare window
35
+ with no context prepended scores even loud speech at the non-speech floor.
59
36
 
60
37
  ## fastenhancer_t.onnx
61
38
 
62
- - **Name:** FastEnhancer-T (tiny tier), VoiceBank-DEMAND checkpoint, waveform variant
63
- - **License:** MIT
39
+ - **Model:** FastEnhancer-T (tiny tier), VoiceBank-DEMAND checkpoint, waveform variant
64
40
  - **Source:** https://github.com/aask1357/fastenhancer (release `onnx-vd-v1.0.0`)
65
41
  - **Size:** ~122 KB (125,036 bytes)
66
42
  - **Purpose:** Single-channel speech enhancement (denoise). Maps a window of noisy speech samples to a hop of cleaned speech samples, frame by frame, for streaming use.
@@ -89,61 +65,3 @@ receives audio samples with no spectral processing of its own. The three cache
89
65
  tensors hold the model's overlap-add and recurrent state. Initialize them to
90
66
  zeros at the start of a stream and feed each call's `cache_out` values back as
91
67
  the next call's `cache_in` values.
92
-
93
- ### License Notice
94
-
95
- This model is a third-party artifact, not proprietary to decibri. The model
96
- code and weights are distributed under the MIT License, reproduced in full
97
- below.
98
-
99
- ```text
100
- MIT License
101
-
102
- Copyright (c) 2025 AHN Sung Hwan
103
-
104
- Permission is hereby granted, free of charge, to any person obtaining a copy
105
- of this software and associated documentation files (the "Software"), to deal
106
- in the Software without restriction, including without limitation the rights
107
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
108
- copies of the Software, and to permit persons to whom the Software is
109
- furnished to do so, subject to the following conditions:
110
-
111
- The above copyright notice and this permission notice shall be included in all
112
- copies or substantial portions of the Software.
113
-
114
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
115
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
116
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
117
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
118
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
119
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
120
- SOFTWARE.
121
- ```
122
-
123
- ### Training-Data Attribution
124
-
125
- The bundled checkpoint is trained on the VoiceBank-DEMAND noisy speech dataset,
126
- which pairs clean speech from the CSTR VCTK Corpus with noise from the DEMAND
127
- database. Each source dataset requires attribution:
128
-
129
- - **VoiceBank-DEMAND.** Valentini-Botinhao, Cassia. (2017). Noisy speech
130
- database for training speech enhancement algorithms and TTS models, 2016
131
- [sound]. University of Edinburgh, School of Informatics, Centre for Speech
132
- Technology Research (CSTR). Licensed under Creative Commons Attribution 4.0
133
- International (CC BY 4.0), https://creativecommons.org/licenses/by/4.0/.
134
- https://doi.org/10.7488/ds/2117
135
-
136
- - **CSTR VCTK Corpus (version 0.92).** Yamagishi, Junichi; Veaux, Christophe;
137
- MacDonald, Kirsten. (2019). CSTR VCTK Corpus: English Multi-speaker Corpus
138
- for CSTR Voice Cloning Toolkit (version 0.92) [sound]. University of
139
- Edinburgh, Centre for Speech Technology Research (CSTR). Licensed under the
140
- Open Data Commons Attribution License (ODC-By) v1.0,
141
- https://opendatacommons.org/licenses/by/1-0/.
142
- https://doi.org/10.7488/ds/2645
143
-
144
- - **DEMAND.** Thiemann, Joachim; Ito, Nobutaka; Vincent, Emmanuel. (2013).
145
- DEMAND: a collection of multi-channel recordings of acoustic noise in
146
- diverse environments. Licensed under Creative Commons
147
- Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0),
148
- https://creativecommons.org/licenses/by-sa/3.0/.
149
- https://doi.org/10.5281/zenodo.1227121
@@ -0,0 +1,110 @@
1
+ # Third-Party Notices
2
+
3
+ This directory redistributes the model files listed below, together with the
4
+ license notices they require. The notices ship inside the published npm and
5
+ PyPI packages alongside the model weights they cover, so the attribution
6
+ travels with the files. `README.md` beside this file documents each model's
7
+ tensor interface.
8
+
9
+ ## Silero VAD
10
+
11
+ - **Name:** Silero VAD
12
+ - **Version:** v6.2
13
+ - **License:** MIT
14
+ - **Source:** https://github.com/snakers4/silero-vad (release `v6.2`)
15
+ - **Files covered:** `silero_vad.onnx`
16
+
17
+ ### License Notice
18
+
19
+ This model is a third-party artifact, not proprietary to decibri. It is
20
+ distributed under the MIT License, reproduced in full below.
21
+
22
+ ```text
23
+ MIT License
24
+
25
+ Copyright (c) 2020-present Silero Team
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy
28
+ of this software and associated documentation files (the "Software"), to deal
29
+ in the Software without restriction, including without limitation the rights
30
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
+ copies of the Software, and to permit persons to whom the Software is
32
+ furnished to do so, subject to the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be included in all
35
+ copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
+ SOFTWARE.
44
+ ```
45
+
46
+ ## FastEnhancer
47
+
48
+ - **Name:** FastEnhancer-T (tiny tier), VoiceBank-DEMAND checkpoint, waveform variant
49
+ - **Version:** `onnx-vd-v1.0.0`
50
+ - **License:** MIT
51
+ - **Source:** https://github.com/aask1357/fastenhancer (release `onnx-vd-v1.0.0`)
52
+ - **Files covered:** `fastenhancer_t.onnx`
53
+
54
+ ### License Notice
55
+
56
+ This model is a third-party artifact, not proprietary to decibri. The model
57
+ code and weights are distributed under the MIT License, reproduced in full
58
+ below.
59
+
60
+ ```text
61
+ MIT License
62
+
63
+ Copyright (c) 2025 AHN Sung Hwan
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy
66
+ of this software and associated documentation files (the "Software"), to deal
67
+ in the Software without restriction, including without limitation the rights
68
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69
+ copies of the Software, and to permit persons to whom the Software is
70
+ furnished to do so, subject to the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be included in all
73
+ copies or substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
+ SOFTWARE.
82
+ ```
83
+
84
+ ### Training-Data Attribution
85
+
86
+ The bundled checkpoint is trained on the VoiceBank-DEMAND noisy speech dataset,
87
+ which pairs clean speech from the CSTR VCTK Corpus with noise from the DEMAND
88
+ database. Each source dataset requires attribution:
89
+
90
+ - **VoiceBank-DEMAND.** Valentini-Botinhao, Cassia. (2017). Noisy speech
91
+ database for training speech enhancement algorithms and TTS models, 2016
92
+ [sound]. University of Edinburgh, School of Informatics, Centre for Speech
93
+ Technology Research (CSTR). Licensed under Creative Commons Attribution 4.0
94
+ International (CC BY 4.0), https://creativecommons.org/licenses/by/4.0/.
95
+ https://doi.org/10.7488/ds/2117
96
+
97
+ - **CSTR VCTK Corpus (version 0.92).** Yamagishi, Junichi; Veaux, Christophe;
98
+ MacDonald, Kirsten. (2019). CSTR VCTK Corpus: English Multi-speaker Corpus
99
+ for CSTR Voice Cloning Toolkit (version 0.92) [sound]. University of
100
+ Edinburgh, Centre for Speech Technology Research (CSTR). Licensed under the
101
+ Open Data Commons Attribution License (ODC-By) v1.0,
102
+ https://opendatacommons.org/licenses/by/1-0/.
103
+ https://doi.org/10.7488/ds/2645
104
+
105
+ - **DEMAND.** Thiemann, Joachim; Ito, Nobutaka; Vincent, Emmanuel. (2013).
106
+ DEMAND: a collection of multi-channel recordings of acoustic noise in
107
+ diverse environments. Licensed under Creative Commons
108
+ Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0),
109
+ https://creativecommons.org/licenses/by-sa/3.0/.
110
+ https://doi.org/10.5281/zenodo.1227121
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decibri",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Cross-platform audio capture, playback, and processing for Node.js and browsers",
5
5
  "main": "src/decibri.js",
6
6
  "types": "src/decibri.d.ts",
@@ -72,10 +72,10 @@
72
72
  "MIGRATION.md"
73
73
  ],
74
74
  "optionalDependencies": {
75
- "@decibri/decibri-win32-x64-msvc": "5.4.0",
76
- "@decibri/decibri-darwin-arm64": "5.4.0",
77
- "@decibri/decibri-linux-x64-gnu": "5.4.0",
78
- "@decibri/decibri-linux-arm64-gnu": "5.4.0"
75
+ "@decibri/decibri-win32-x64-msvc": "5.5.0",
76
+ "@decibri/decibri-darwin-arm64": "5.5.0",
77
+ "@decibri/decibri-linux-x64-gnu": "5.5.0",
78
+ "@decibri/decibri-linux-arm64-gnu": "5.5.0"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@napi-rs/cli": "^3.7.0"
@@ -6,7 +6,7 @@ const { WORKLET_SOURCE } = require('./worklet-inline.js');
6
6
  // Browser build version. Keep in sync with package.json on each release; the
7
7
  // browser bundle cannot read package.json at runtime the way the Node wrapper
8
8
  // does, so this is a maintained constant.
9
- const VERSION = '5.4.0';
9
+ const VERSION = '5.5.0';
10
10
 
11
11
  /**
12
12
  * Browser microphone capture.
@@ -105,6 +105,19 @@ class Microphone extends Emitter {
105
105
  if (this._sampleRate < 1000 || this._sampleRate > 384000) {
106
106
  throw new RangeError('sample rate must be between 1000 and 384000');
107
107
  }
108
+ // Mono only: the worklet reads a single channel. The classes and the
109
+ // messages are the node entry's, so the same value is rejected the same
110
+ // way in both runtimes.
111
+ if (this._channels < 1) {
112
+ throw new RangeError('channels must be at least 1');
113
+ }
114
+ if (this._channels > 1) {
115
+ throw new RangeError('multichannel capture is not supported; channels must be 1 (mono)');
116
+ }
117
+ // The Web Audio specification's floor, as on the browser Speaker: an
118
+ // implementation is required to support up to 32 channels and says nothing
119
+ // above that. Deliberately unlike the native surface, which bounds channels
120
+ // below only.
108
121
  if (this._channels < 1 || this._channels > 32) {
109
122
  throw new TypeError(`channels must be between 1 and 32, got ${this._channels}`);
110
123
  }
@@ -104,6 +104,12 @@ class Speaker {
104
104
  if (this._sampleRate < 1000 || this._sampleRate > 384000) {
105
105
  throw new TypeError(`sample rate must be between 1000 and 384000, got ${this._sampleRate}`);
106
106
  }
107
+ // The 32 is the Web Audio specification's floor: an implementation is
108
+ // required to support up to 32 channels and the specification says nothing
109
+ // above that, so 32 is what a browser can be relied on to accept. The
110
+ // native surface bounds output channels below only and leaves the maximum
111
+ // to the device; the two differ deliberately, because they are answering to
112
+ // different things.
107
113
  if (this._channels < 1 || this._channels > 32) {
108
114
  throw new TypeError(`channels must be between 1 and 32, got ${this._channels}`);
109
115
  }
@@ -47,9 +47,12 @@ export interface MicrophoneOptions {
47
47
  sampleRate?: number;
48
48
 
49
49
  /**
50
- * Number of input channels.
50
+ * Number of input channels. Mono only: the only accepted value is `1`, and a
51
+ * value greater than `1` throws a `RangeError` (multichannel capture is not
52
+ * supported) rather than being silently downmixed. The option is kept for
53
+ * forward compatibility: a future release may accept a value greater than `1`
54
+ * by delivering true interleaved multichannel.
51
55
  * @default 1
52
- * @range 1–32
53
56
  */
54
57
  channels?: number;
55
58
 
@@ -67,9 +67,13 @@ class Speaker extends Writable {
67
67
  throw new RangeError('sample rate must be between 1000 and 384000');
68
68
  }
69
69
 
70
+ // Bounded below only. How many output channels can be carried is the
71
+ // device's answer, so any count above zero is passed through and a device
72
+ // that refuses it throws a DecibriError with code
73
+ // 'SPEAKER_CHANNELS_UNSUPPORTED' naming the count the device reports.
70
74
  const channels = options.channels ?? 1;
71
- if (channels < 1 || channels > 32) {
72
- throw new RangeError('channels must be between 1 and 32');
75
+ if (channels < 1) {
76
+ throw new RangeError('channels must be at least 1');
73
77
  }
74
78
 
75
79
  const dtype = options.dtype ?? 'int16';
package/src/decibri.d.ts CHANGED
@@ -42,7 +42,7 @@ export interface VersionInfo {
42
42
  export interface VadOptions {
43
43
  /**
44
44
  * Which detector to run.
45
- * - `'silero'`: Silero VAD v5 ML model (more accurate, ~1ms inference)
45
+ * - `'silero'`: Silero VAD v6.2 ML model (more accurate, ~1ms inference)
46
46
  * - `'energy'`: RMS energy threshold (lightweight, no model)
47
47
  */
48
48
  model: 'silero' | 'energy';
@@ -105,6 +105,32 @@ export interface AecOptions {
105
105
  * @range 1000 to 384000
106
106
  */
107
107
  referenceSampleRate?: number;
108
+
109
+ /**
110
+ * Number of channels in the far-end reference pushed through
111
+ * `pushAecReference`, frame-interleaved. When it names a count above 1,
112
+ * decibri averages each frame to one mono sample before the canceller sees
113
+ * it: a multichannel reference pushed without declaring the count cancels
114
+ * nothing and reports no error, so the collapse is decibri's rather than
115
+ * the caller's.
116
+ *
117
+ * The declared count must match the buffer actually pushed. The reference
118
+ * arrives as flat PCM whose true channel count is not recoverable from its
119
+ * length, so a mismatch is not detected and raises no error: the frames
120
+ * are misread, nothing is cancelled, and the observable signature is
121
+ * `aecMetrics().delaySamples` staying `null` while the canceller reports
122
+ * no fault.
123
+ *
124
+ * The canceller itself reads one mono reference. Against playback through
125
+ * more than one loudspeaker that is a cancellation ceiling: the echo
126
+ * reaching the microphone is the sum of different room responses driven by
127
+ * different signals, and a single-reference canceller models one response
128
+ * applied to their average, so a placement where those paths differ leaves
129
+ * a residual that no amount of adaptation removes.
130
+ * @default 1 (mono)
131
+ * @range at least 1; no upper bound
132
+ */
133
+ referenceChannels?: number;
108
134
  }
109
135
 
110
136
  /**
@@ -211,7 +237,7 @@ export interface MicrophoneOptions extends ReadableOptions {
211
237
  /**
212
238
  * Voice activity detection. One of:
213
239
  * - `false`: disabled (default)
214
- * - `'silero'`: Silero VAD v5 ML model (more accurate, ~1ms inference)
240
+ * - `'silero'`: Silero VAD v6.2 ML model (more accurate, ~1ms inference)
215
241
  * - `'energy'`: RMS energy threshold (lightweight)
216
242
  * - a `VadOptions` config object `{ model, threshold?, holdoffMs? }` to tune
217
243
  * the threshold and holdoff for the chosen model
@@ -371,8 +397,14 @@ export declare class Microphone extends Readable {
371
397
  * Queue far-end reference audio for the echo canceller: the audio being
372
398
  * played out, pushed as it is played, in played order. Accepts the same
373
399
  * input shapes `Speaker.write` accepts (a `Buffer`, any TypedArray, or a
374
- * `DataView` of PCM bytes in this microphone's `dtype`), mono, at the
375
- * declared `referenceSampleRate` (the capture rate when unset).
400
+ * `DataView` of PCM bytes in this microphone's `dtype`), at the declared
401
+ * `referenceSampleRate` (the capture rate when unset), interleaved at the
402
+ * declared `referenceChannels` (mono when unset). With `referenceChannels`
403
+ * above 1, each frame is averaged to one mono sample before the canceller
404
+ * sees it. The declared count must match this buffer's actual
405
+ * interleaving: a mismatch is not detected and raises no error, and shows
406
+ * up only as `aecMetrics().delaySamples` staying `null` with no fault
407
+ * reported.
376
408
  *
377
409
  * Never blocks and never throws on a full queue: samples that do not fit
378
410
  * are discarded and counted by `aecMetrics().referenceDropped`. Silence
@@ -810,9 +842,11 @@ export interface SpeakerOptions extends WritableOptions {
810
842
  sampleRate?: number;
811
843
 
812
844
  /**
813
- * Number of output channels.
845
+ * Number of output channels. The maximum is the device's: a count the device
846
+ * cannot serve throws a `DecibriError` with code
847
+ * `'SPEAKER_CHANNELS_UNSUPPORTED'` naming the count the device reports.
814
848
  * @default 1
815
- * @range 1–32
849
+ * @range 1 or more
816
850
  */
817
851
  channels?: number;
818
852
 
package/src/decibri.js CHANGED
@@ -151,7 +151,7 @@ class Microphone extends Readable {
151
151
  // additive. The `channels` option is kept for that forward compatibility.
152
152
  const channels = options.channels ?? 1;
153
153
  if (channels < 1) {
154
- throw new RangeError('channels must be between 1 and 32');
154
+ throw new RangeError('channels must be at least 1');
155
155
  }
156
156
  if (channels > 1) {
157
157
  throw new RangeError('multichannel capture is not supported; channels must be 1 (mono)');
@@ -345,8 +345,8 @@ class Microphone extends Readable {
345
345
  // ── Validate AEC ─────────────────────────────────────────────────────────
346
346
 
347
347
  // Echo cancellation: the 'tau' shorthand names the model, or an
348
- // { model, tailMs, suppression, referenceSampleRate } object tunes it;
349
- // absence leaves it off. The model name is deliberately NOT checked
348
+ // { model, tailMs, suppression, referenceSampleRate, referenceChannels }
349
+ // object tunes it; absence leaves it off. The model name is deliberately NOT checked
350
350
  // against a list here: the canceller owns the accepted set, so the native
351
351
  // layer parses it (AecModel::from_str) and an unknown name is rejected by
352
352
  // the native constructor with the canceller's own message (a DecibriError
@@ -360,11 +360,12 @@ class Microphone extends Readable {
360
360
  let aecTailMs;
361
361
  let aecSuppression;
362
362
  let aecReferenceSampleRate;
363
+ let aecReferenceChannels;
363
364
  if (aec !== undefined) {
364
365
  if (typeof aec === 'string') {
365
366
  aecModel = aec;
366
367
  } else if (aec !== null && typeof aec === 'object' && !Array.isArray(aec)) {
367
- const { model, tailMs, suppression, referenceSampleRate } = aec;
368
+ const { model, tailMs, suppression, referenceSampleRate, referenceChannels } = aec;
368
369
  if (typeof model !== 'string') {
369
370
  throw new TypeError(
370
371
  `Invalid aec model: ${JSON.stringify(model)}. Expected a model name string such as 'tau'.`
@@ -397,9 +398,18 @@ class Microphone extends Readable {
397
398
  }
398
399
  aecReferenceSampleRate = referenceSampleRate;
399
400
  }
401
+ if (referenceChannels !== undefined) {
402
+ if (typeof referenceChannels !== 'number' || Number.isNaN(referenceChannels)) {
403
+ throw new TypeError('aec referenceChannels must be a number');
404
+ }
405
+ if (referenceChannels < 1) {
406
+ throw new RangeError('aec referenceChannels must be at least 1');
407
+ }
408
+ aecReferenceChannels = referenceChannels;
409
+ }
400
410
  } else {
401
411
  throw new TypeError(
402
- `Invalid aec value: ${JSON.stringify(aec)}. Expected a model name such as 'tau', or a config object { model, tailMs, suppression, referenceSampleRate }.`
412
+ `Invalid aec value: ${JSON.stringify(aec)}. Expected a model name such as 'tau', or a config object { model, tailMs, suppression, referenceSampleRate, referenceChannels }.`
403
413
  );
404
414
  }
405
415
  }
@@ -443,6 +453,7 @@ class Microphone extends Readable {
443
453
  aecTailMs,
444
454
  aecSuppression,
445
455
  aecReferenceSampleRate,
456
+ aecReferenceChannels,
446
457
  },
447
458
  };
448
459
  }
@@ -605,8 +616,15 @@ class Microphone extends Readable {
605
616
  * Queue far-end reference audio for the echo canceller: the audio being
606
617
  * played out, pushed as it is played, in played order. Accepts the same
607
618
  * input shapes `Speaker.write` accepts (a `Buffer`, any TypedArray, or a
608
- * `DataView` of PCM bytes in this microphone's `dtype`), mono, at the
609
- * declared `referenceSampleRate` (the capture rate when unset).
619
+ * `DataView` of PCM bytes in this microphone's `dtype`), at the declared
620
+ * `referenceSampleRate` (the capture rate when unset), interleaved at the
621
+ * declared `referenceChannels` (mono when unset). With `referenceChannels`
622
+ * above 1, each frame is averaged to one mono sample before the canceller
623
+ * sees it; a multichannel reference pushed without declaring the count
624
+ * cancels nothing and reports no error. The declared count must match this
625
+ * buffer's actual interleaving: a mismatch is not detected and raises no
626
+ * error, and shows up only as `aecMetrics().delaySamples` staying `null`
627
+ * with no fault reported.
610
628
  *
611
629
  * Never blocks and never throws on a full queue: samples that do not fit
612
630
  * are discarded and counted by `aecMetrics().referenceDropped`, and the
package/src/errors.js CHANGED
@@ -75,7 +75,7 @@ class OrtPathError extends OrtError {
75
75
  // the core ever sees it).
76
76
  const RANGE_PREFIXES = [
77
77
  'sample rate must be between',
78
- 'channels must be between',
78
+ 'channels must be at least',
79
79
  'multichannel capture is not supported',
80
80
  'frames per buffer must be between',
81
81
  'agc target level must be between',
@@ -83,6 +83,7 @@ const RANGE_PREFIXES = [
83
83
  'flac compression level must be between',
84
84
  'aec tailMs must be between',
85
85
  'aec referenceSampleRate must be between',
86
+ 'aec referenceChannels must be at',
86
87
  'Silero VAD only supports',
87
88
  'VAD threshold must be between',
88
89
  'echo cancellation only supports',
@@ -125,6 +126,7 @@ const BASE_CODES = [
125
126
  ['audio stream is already running', 'ALREADY_RUNNING'],
126
127
  ['Failed to open audio stream', 'STREAM_OPEN_FAILED'],
127
128
  ['Failed to start audio stream', 'STREAM_START_FAILED'],
129
+ ['the output device does not support', 'SPEAKER_CHANNELS_UNSUPPORTED'],
128
130
  ['Microphone permission denied.', 'PERMISSION_DENIED'],
129
131
  ['Microphone stream is closed', 'MICROPHONE_STREAM_CLOSED'],
130
132
  ['Speaker stream is closed', 'SPEAKER_STREAM_CLOSED'],