decibri 5.4.0 → 5.6.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 +66 -1
- package/MIGRATION.md +8 -12
- package/README.md +22 -11
- package/examples/decibri.browser.js +94 -11
- package/index.d.ts +105 -15
- package/index.js +52 -52
- package/models/README.md +21 -103
- package/models/THIRD-PARTY-NOTICES.md +110 -0
- package/package.json +5 -5
- package/src/browser/decibri-browser.js +177 -15
- package/src/browser/decibri-output-browser.js +6 -0
- package/src/browser/index.d.ts +58 -4
- package/src/browser/worklet-inline.js +2 -2
- package/src/browser/worklet-processor.js +116 -32
- package/src/decibri-output.js +6 -2
- package/src/decibri.d.ts +223 -28
- package/src/decibri.js +254 -42
- package/src/errors.js +12 -2
package/index.d.ts
CHANGED
|
@@ -33,8 +33,10 @@ export declare class DecibriBridge {
|
|
|
33
33
|
* Queue far-end reference audio for the echo canceller. `buffer` is mono
|
|
34
34
|
* PCM bytes in the bridge's configured format, at the declared reference
|
|
35
35
|
* rate, in played order. Never blocks and never fails: a full queue
|
|
36
|
-
* discards and counts rather than erroring
|
|
37
|
-
*
|
|
36
|
+
* discards and counts rather than erroring. A push with no active stream
|
|
37
|
+
* (not started, or stopped) is discarded and counted into the
|
|
38
|
+
* `referenceDropped` metric when a canceller is configured; with echo
|
|
39
|
+
* cancellation off it is a no-op.
|
|
38
40
|
*/
|
|
39
41
|
pushAecReference(buffer: Buffer): void
|
|
40
42
|
/**
|
|
@@ -42,6 +44,11 @@ export declare class DecibriBridge {
|
|
|
42
44
|
* reference queue's own counters, or `null` when no stream is active or
|
|
43
45
|
* echo cancellation is off. Counters are returned as f64 (exact JS numbers
|
|
44
46
|
* for any realistic count), matching the `overrunCount` getter.
|
|
47
|
+
*
|
|
48
|
+
* The top-level engine fields report the first delivered channel's
|
|
49
|
+
* canceller; `channels` carries every delivered channel's engine report in
|
|
50
|
+
* delivered order, one entry per channel, so the two agree on a
|
|
51
|
+
* single-channel stream.
|
|
45
52
|
*/
|
|
46
53
|
aecMetrics(): AecMetricsJs | null
|
|
47
54
|
/** List all available audio input devices. */
|
|
@@ -126,8 +133,9 @@ export declare class FileHandle {
|
|
|
126
133
|
*/
|
|
127
134
|
static openAsync(path: string, options?: FileOptions | undefined | null): Promise<unknown>
|
|
128
135
|
/**
|
|
129
|
-
* Wrap in-memory samples as an offline source. `samples` are
|
|
130
|
-
* [-1.0, 1.0]
|
|
136
|
+
* Wrap in-memory samples as an offline source. `samples` are f32 in
|
|
137
|
+
* [-1.0, 1.0], frame-interleaved at the options' `inputChannels` (1
|
|
138
|
+
* when unset); `inputRate` is their native rate (raw samples carry no
|
|
131
139
|
* header). No I/O, so construction is synchronous.
|
|
132
140
|
*/
|
|
133
141
|
static buffer(samples: Float32Array, inputRate: number, options?: FileOptions | undefined | null): FileHandle
|
|
@@ -173,6 +181,49 @@ export declare class FileHandle {
|
|
|
173
181
|
get inputRate(): number
|
|
174
182
|
}
|
|
175
183
|
|
|
184
|
+
/**
|
|
185
|
+
* One delivered channel's canceller report inside `AecMetricsJs.channels`.
|
|
186
|
+
* Engine-level fields only: the reference queue's counters (`referenceDropped`,
|
|
187
|
+
* `referenceSilence`) describe the shared queue and stay on the top level.
|
|
188
|
+
*/
|
|
189
|
+
export interface AecChannelMetricsJs {
|
|
190
|
+
/**
|
|
191
|
+
* This channel's active delay alignment in samples, or `null` while its
|
|
192
|
+
* estimator is still searching. The offset from the reference frontier as
|
|
193
|
+
* the feeding established it, not a measurement of the room's echo path.
|
|
194
|
+
*/
|
|
195
|
+
delaySamples?: number
|
|
196
|
+
/**
|
|
197
|
+
* This channel's smoothed echo-return-loss-enhancement estimate in dB.
|
|
198
|
+
* Not a quality ranking across channels: ERLE rises with echo distance,
|
|
199
|
+
* because a weaker echo is easier to reduce in ratio terms, so a far
|
|
200
|
+
* microphone routinely reports a higher figure than a near one while
|
|
201
|
+
* removing less echo in absolute terms. Compare a channel against its own
|
|
202
|
+
* history, not against its neighbours.
|
|
203
|
+
*/
|
|
204
|
+
erleDb: number
|
|
205
|
+
/**
|
|
206
|
+
* Whether this channel's double-talk detector currently believes the
|
|
207
|
+
* near-end talker is active; its adaptation is held while true.
|
|
208
|
+
*/
|
|
209
|
+
doubleTalk: boolean
|
|
210
|
+
/**
|
|
211
|
+
* Near-end samples this channel's canceller could find no far-end sample
|
|
212
|
+
* for while an alignment was active.
|
|
213
|
+
*/
|
|
214
|
+
referenceStarved: number
|
|
215
|
+
/**
|
|
216
|
+
* Near-end samples this channel processed while no delay alignment was
|
|
217
|
+
* active: the searching span, not a transport failure.
|
|
218
|
+
*/
|
|
219
|
+
acquisitionParked: number
|
|
220
|
+
/**
|
|
221
|
+
* Times this channel's canceller inferred a capture discontinuity and
|
|
222
|
+
* rebuilt its alignment from the reference frontier.
|
|
223
|
+
*/
|
|
224
|
+
referenceReanchors: number
|
|
225
|
+
}
|
|
226
|
+
|
|
176
227
|
/**
|
|
177
228
|
* Echo-cancellation metrics returned to JS by `aecMetrics()`. One object
|
|
178
229
|
* carries the canceller's own report and the reference queue's counters, so a
|
|
@@ -215,10 +266,11 @@ export interface AecMetricsJs {
|
|
|
215
266
|
*/
|
|
216
267
|
referenceReanchors: number
|
|
217
268
|
/**
|
|
218
|
-
* Far-end samples discarded
|
|
219
|
-
* queue's bound,
|
|
220
|
-
*
|
|
221
|
-
* that
|
|
269
|
+
* Far-end samples discarded, at the declared reference rate: a single
|
|
270
|
+
* push exceeded the reference queue's bound, or the push arrived while
|
|
271
|
+
* capture was not running. The span an oversized push occupied is still
|
|
272
|
+
* represented as silence, so that discard costs the cancellation of the
|
|
273
|
+
* span alone.
|
|
222
274
|
*/
|
|
223
275
|
referenceDropped: number
|
|
224
276
|
/**
|
|
@@ -227,6 +279,15 @@ export interface AecMetricsJs {
|
|
|
227
279
|
* fault: while nothing is playing, the far end is silence.
|
|
228
280
|
*/
|
|
229
281
|
referenceSilence: number
|
|
282
|
+
/**
|
|
283
|
+
* Every delivered channel's canceller report, in delivered order, one
|
|
284
|
+
* entry per channel. One canceller engine runs per delivered channel,
|
|
285
|
+
* each fed the same pushed reference and each finding its own channel's
|
|
286
|
+
* echo delay, so the entries differ where the channels' acoustic paths
|
|
287
|
+
* differ. On a single-channel stream this holds one entry agreeing with
|
|
288
|
+
* the top-level fields.
|
|
289
|
+
*/
|
|
290
|
+
channels: Array<AecChannelMetricsJs>
|
|
230
291
|
}
|
|
231
292
|
|
|
232
293
|
/**
|
|
@@ -257,6 +318,15 @@ export interface AecMetricsJs {
|
|
|
257
318
|
export interface DecibriOptions {
|
|
258
319
|
sampleRate?: number
|
|
259
320
|
channels?: number
|
|
321
|
+
/**
|
|
322
|
+
* Capture channel map: 0-based device channel indices, one per delivered
|
|
323
|
+
* channel (the shape of CoreAudio AUHAL's channel map, an index list, not
|
|
324
|
+
* miniaudio's spatial `channelMap`). Absent delivers the documented
|
|
325
|
+
* average of every opened channel. Entries are validated against the
|
|
326
|
+
* resolved device's own report when the stream starts; no fixed maximum
|
|
327
|
+
* exists.
|
|
328
|
+
*/
|
|
329
|
+
channelMap?: Array<number>
|
|
260
330
|
framesPerBuffer?: number
|
|
261
331
|
format?: string
|
|
262
332
|
device?: any
|
|
@@ -324,6 +394,17 @@ export interface DecibriOptions {
|
|
|
324
394
|
* when `aec` names a model.
|
|
325
395
|
*/
|
|
326
396
|
aecReferenceSampleRate?: number
|
|
397
|
+
/**
|
|
398
|
+
* Number of channels in the far-end reference pushed through
|
|
399
|
+
* `pushAecReference`, at least 1. Absent means the reference is mono;
|
|
400
|
+
* when it names a count above 1, the core collapses each interleaved
|
|
401
|
+
* frame to one mono sample before the canceller sees it. The declared
|
|
402
|
+
* count must match the pushed buffer: a mismatch is not detected and
|
|
403
|
+
* raises no error, and shows up only as `aecMetrics().delaySamples`
|
|
404
|
+
* staying `null` with no fault reported. Consulted only when `aec`
|
|
405
|
+
* names a model.
|
|
406
|
+
*/
|
|
407
|
+
aecReferenceChannels?: number
|
|
327
408
|
}
|
|
328
409
|
|
|
329
410
|
/** Options passed from JS constructor for output. */
|
|
@@ -340,8 +421,10 @@ export interface DeviceInfoJs {
|
|
|
340
421
|
name: string
|
|
341
422
|
/**
|
|
342
423
|
* Stable per-host device ID suitable for `device: { id: ... }` selection.
|
|
343
|
-
*
|
|
344
|
-
*
|
|
424
|
+
* The lowercase host name, a colon, then the platform device identifier:
|
|
425
|
+
* `wasapi:` then the endpoint ID on Windows, `coreaudio:` then the device
|
|
426
|
+
* UID on macOS, `alsa:` then the PCM identifier on Linux. Empty string if
|
|
427
|
+
* cpal cannot produce a stable ID for this device.
|
|
345
428
|
*/
|
|
346
429
|
id: string
|
|
347
430
|
maxInputChannels: number
|
|
@@ -351,14 +434,21 @@ export interface DeviceInfoJs {
|
|
|
351
434
|
|
|
352
435
|
/**
|
|
353
436
|
* Options passed from the JS `File` wrapper. The conditioning fields mirror
|
|
354
|
-
* `DecibriOptions` exactly
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
437
|
+
* `DecibriOptions` exactly, as do `channels` and `channelMap`, with the
|
|
438
|
+
* source's own channel count standing where the device's report stands; the
|
|
439
|
+
* live-capture-only fields (device, framesPerBuffer) do not apply to an
|
|
440
|
+
* offline source. `inputChannels` is the interleave of the caller's own
|
|
441
|
+
* samples and is honoured by `FileHandle::buffer` alone (a path's count
|
|
442
|
+
* comes from its header; the JS wrapper refuses the option on the open
|
|
443
|
+
* path). `vadThreshold` and `vadHoldoffMs` are internal plumbing (the user
|
|
444
|
+
* passes them on the `vad` config object; the wrapper resolves them),
|
|
445
|
+
* hidden from the generated TypeScript like `ortLibraryPath`.
|
|
359
446
|
*/
|
|
360
447
|
export interface FileOptions {
|
|
361
448
|
sampleRate?: number
|
|
449
|
+
channels?: number
|
|
450
|
+
channelMap?: Array<number>
|
|
451
|
+
inputChannels?: number
|
|
362
452
|
format?: string
|
|
363
453
|
vadMode?: string
|
|
364
454
|
modelPath?: string
|
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.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
80
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
96
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
117
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
133
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
150
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
166
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
185
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
201
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
217
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
237
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
253
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
274
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
290
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
308
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
324
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
342
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
358
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
376
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
392
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
410
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
426
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
443
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
459
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
479
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
495
|
+
if (bindingPackageVersion !== '5.6.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.6.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.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
511
|
+
if (bindingPackageVersion !== '5.6.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.6.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
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
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
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
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
|
-
- `
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
of
|
|
43
|
-
|
|
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
|
-
- **
|
|
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
|