deepfilternet3-assets 1.0.0 → 1.0.2
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/README.md +7 -7
- package/package.json +3 -1
- package/pkg/df.d.ts +104 -0
- package/pkg/df.js +399 -0
- package/pkg/df_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# deepfilternet3-assets
|
|
2
2
|
|
|
3
3
|
DeepFilterNet3 WASM and model assets for noise suppression.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install deepfilternet3-assets
|
|
9
9
|
# or
|
|
10
|
-
yarn add
|
|
10
|
+
yarn add deepfilternet3-assets
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Contents
|
|
@@ -21,7 +21,7 @@ This package includes:
|
|
|
21
21
|
### Getting Asset Paths (Node.js)
|
|
22
22
|
|
|
23
23
|
```javascript
|
|
24
|
-
const { getWasmPath, getModelPath, getAssetPaths } = require('
|
|
24
|
+
const { getWasmPath, getModelPath, getAssetPaths } = require('deepfilternet3-assets');
|
|
25
25
|
|
|
26
26
|
// Get individual paths
|
|
27
27
|
const wasmPath = getWasmPath();
|
|
@@ -36,7 +36,7 @@ const { wasm, model } = getAssetPaths();
|
|
|
36
36
|
For web applications, you can use the relative paths:
|
|
37
37
|
|
|
38
38
|
```javascript
|
|
39
|
-
const { WASM_RELATIVE_PATH, MODEL_RELATIVE_PATH } = require('
|
|
39
|
+
const { WASM_RELATIVE_PATH, MODEL_RELATIVE_PATH } = require('deepfilternet3-assets');
|
|
40
40
|
|
|
41
41
|
// Then use with your bundler's asset handling
|
|
42
42
|
// For example, with Webpack or Vite
|
|
@@ -48,7 +48,7 @@ You can copy these files to your static assets directory or CDN:
|
|
|
48
48
|
|
|
49
49
|
```javascript
|
|
50
50
|
const fs = require('fs');
|
|
51
|
-
const { getAssetPaths } = require('
|
|
51
|
+
const { getAssetPaths } = require('deepfilternet3-assets');
|
|
52
52
|
|
|
53
53
|
const assets = getAssetPaths();
|
|
54
54
|
|
|
@@ -62,7 +62,7 @@ fs.copyFileSync(assets.model, './public/models/DeepFilterNet3_onnx.tar.gz');
|
|
|
62
62
|
This package includes TypeScript type definitions:
|
|
63
63
|
|
|
64
64
|
```typescript
|
|
65
|
-
import { getAssetPaths, WASM_RELATIVE_PATH, MODEL_RELATIVE_PATH } from '
|
|
65
|
+
import { getAssetPaths, WASM_RELATIVE_PATH, MODEL_RELATIVE_PATH } from 'deepfilternet3-assets';
|
|
66
66
|
|
|
67
67
|
const { wasm, model } = getAssetPaths();
|
|
68
68
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepfilternet3-assets",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "DeepFilterNet3 WASM and model assets for noise suppression",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"pkg/df_bg.wasm",
|
|
9
|
+
"pkg/df.js",
|
|
10
|
+
"pkg/df.d.ts",
|
|
9
11
|
"models/DeepFilterNet3_onnx.tar.gz",
|
|
10
12
|
"index.js",
|
|
11
13
|
"index.d.ts",
|
package/pkg/df.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Create a DeepFilterNet Model
|
|
5
|
+
*
|
|
6
|
+
* Args:
|
|
7
|
+
* - path: File path to a DeepFilterNet tar.gz onnx model
|
|
8
|
+
* - atten_lim: Attenuation limit in dB.
|
|
9
|
+
*
|
|
10
|
+
* Returns:
|
|
11
|
+
* - DF state doing the full processing: stft, DNN noise reduction, istft.
|
|
12
|
+
* @param {Uint8Array} model_bytes
|
|
13
|
+
* @param {number} atten_lim
|
|
14
|
+
* @returns {number}
|
|
15
|
+
*/
|
|
16
|
+
export function df_create(model_bytes: Uint8Array, atten_lim: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Get DeepFilterNet frame size in samples.
|
|
19
|
+
* @param {number} st
|
|
20
|
+
* @returns {number}
|
|
21
|
+
*/
|
|
22
|
+
export function df_get_frame_length(st: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* @param {number} st
|
|
25
|
+
* @param {boolean} enabled
|
|
26
|
+
* @param {number} desired_output_rms
|
|
27
|
+
* @param {number} distortion_factor
|
|
28
|
+
* @param {number} snr_thresh
|
|
29
|
+
*/
|
|
30
|
+
export function df_set_agc_params(st: number, enabled: boolean, desired_output_rms: number, distortion_factor: number, snr_thresh: number): void;
|
|
31
|
+
/**
|
|
32
|
+
* Set DeepFilterNet attenuation limit.
|
|
33
|
+
*
|
|
34
|
+
* Args:
|
|
35
|
+
* - lim_db: New attenuation limit in dB.
|
|
36
|
+
* @param {number} st
|
|
37
|
+
* @param {number} lim_db
|
|
38
|
+
*/
|
|
39
|
+
export function df_set_atten_lim(st: number, lim_db: number): void;
|
|
40
|
+
/**
|
|
41
|
+
* Set DeepFilterNet post filter beta. A beta of 0 disables the post filter.
|
|
42
|
+
*
|
|
43
|
+
* Args:
|
|
44
|
+
* - beta: Post filter attenuation. Suitable range between 0.05 and 0;
|
|
45
|
+
* @param {number} st
|
|
46
|
+
* @param {number} beta
|
|
47
|
+
*/
|
|
48
|
+
export function df_set_post_filter_beta(st: number, beta: number): void;
|
|
49
|
+
/**
|
|
50
|
+
* Processes a chunk of samples.
|
|
51
|
+
*
|
|
52
|
+
* Args:
|
|
53
|
+
* - df_state: Created via df_create()
|
|
54
|
+
* - input: Input buffer of length df_get_frame_length()
|
|
55
|
+
* - output: Output buffer of length df_get_frame_length()
|
|
56
|
+
*
|
|
57
|
+
* Returns:
|
|
58
|
+
* - Local SNR of the current frame.
|
|
59
|
+
* @param {number} st
|
|
60
|
+
* @param {Float32Array} input
|
|
61
|
+
* @returns {Float32Array}
|
|
62
|
+
*/
|
|
63
|
+
export function df_process_frame(st: number, input: Float32Array): Float32Array;
|
|
64
|
+
/**
|
|
65
|
+
*/
|
|
66
|
+
export class DFState {
|
|
67
|
+
free(): void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
71
|
+
|
|
72
|
+
export interface InitOutput {
|
|
73
|
+
readonly memory: WebAssembly.Memory;
|
|
74
|
+
readonly __wbg_dfstate_free: (a: number) => void;
|
|
75
|
+
readonly df_create: (a: number, b: number, c: number) => number;
|
|
76
|
+
readonly df_get_frame_length: (a: number) => number;
|
|
77
|
+
readonly df_process_frame: (a: number, b: number, c: number) => number;
|
|
78
|
+
readonly df_set_agc_params: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
79
|
+
readonly df_set_atten_lim: (a: number, b: number) => void;
|
|
80
|
+
readonly df_set_post_filter_beta: (a: number, b: number) => void;
|
|
81
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
82
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
86
|
+
/**
|
|
87
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
88
|
+
* a precompiled `WebAssembly.Module`.
|
|
89
|
+
*
|
|
90
|
+
* @param {SyncInitInput} module
|
|
91
|
+
*
|
|
92
|
+
* @returns {InitOutput}
|
|
93
|
+
*/
|
|
94
|
+
export function initSync(module: SyncInitInput): InitOutput;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
98
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
99
|
+
*
|
|
100
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
101
|
+
*
|
|
102
|
+
* @returns {Promise<InitOutput>}
|
|
103
|
+
*/
|
|
104
|
+
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/pkg/df.js
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
const heap = new Array(128).fill(undefined);
|
|
4
|
+
|
|
5
|
+
heap.push(undefined, null, true, false);
|
|
6
|
+
|
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
|
8
|
+
|
|
9
|
+
let heap_next = heap.length;
|
|
10
|
+
|
|
11
|
+
function dropObject(idx) {
|
|
12
|
+
if (idx < 132) return;
|
|
13
|
+
heap[idx] = heap_next;
|
|
14
|
+
heap_next = idx;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function takeObject(idx) {
|
|
18
|
+
const ret = getObject(idx);
|
|
19
|
+
dropObject(idx);
|
|
20
|
+
return ret;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
24
|
+
|
|
25
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
26
|
+
|
|
27
|
+
let cachedUint8Memory0 = null;
|
|
28
|
+
|
|
29
|
+
function getUint8Memory0() {
|
|
30
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
31
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
32
|
+
}
|
|
33
|
+
return cachedUint8Memory0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getStringFromWasm0(ptr, len) {
|
|
37
|
+
ptr = ptr >>> 0;
|
|
38
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function addHeapObject(obj) {
|
|
42
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
43
|
+
const idx = heap_next;
|
|
44
|
+
heap_next = heap[idx];
|
|
45
|
+
|
|
46
|
+
heap[idx] = obj;
|
|
47
|
+
return idx;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let WASM_VECTOR_LEN = 0;
|
|
51
|
+
|
|
52
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
53
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
54
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
55
|
+
WASM_VECTOR_LEN = arg.length;
|
|
56
|
+
return ptr;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a DeepFilterNet Model
|
|
60
|
+
*
|
|
61
|
+
* Args:
|
|
62
|
+
* - path: File path to a DeepFilterNet tar.gz onnx model
|
|
63
|
+
* - atten_lim: Attenuation limit in dB.
|
|
64
|
+
*
|
|
65
|
+
* Returns:
|
|
66
|
+
* - DF state doing the full processing: stft, DNN noise reduction, istft.
|
|
67
|
+
* @param {Uint8Array} model_bytes
|
|
68
|
+
* @param {number} atten_lim
|
|
69
|
+
* @returns {number}
|
|
70
|
+
*/
|
|
71
|
+
export function df_create(model_bytes, atten_lim) {
|
|
72
|
+
const ptr0 = passArray8ToWasm0(model_bytes, wasm.__wbindgen_malloc);
|
|
73
|
+
const len0 = WASM_VECTOR_LEN;
|
|
74
|
+
const ret = wasm.df_create(ptr0, len0, atten_lim);
|
|
75
|
+
return ret >>> 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get DeepFilterNet frame size in samples.
|
|
80
|
+
* @param {number} st
|
|
81
|
+
* @returns {number}
|
|
82
|
+
*/
|
|
83
|
+
export function df_get_frame_length(st) {
|
|
84
|
+
const ret = wasm.df_get_frame_length(st);
|
|
85
|
+
return ret >>> 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @param {number} st
|
|
90
|
+
* @param {boolean} enabled
|
|
91
|
+
* @param {number} desired_output_rms
|
|
92
|
+
* @param {number} distortion_factor
|
|
93
|
+
* @param {number} snr_thresh
|
|
94
|
+
*/
|
|
95
|
+
export function df_set_agc_params(st, enabled, desired_output_rms, distortion_factor, snr_thresh) {
|
|
96
|
+
wasm.df_set_agc_params(st, enabled, desired_output_rms, distortion_factor, snr_thresh);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Set DeepFilterNet attenuation limit.
|
|
101
|
+
*
|
|
102
|
+
* Args:
|
|
103
|
+
* - lim_db: New attenuation limit in dB.
|
|
104
|
+
* @param {number} st
|
|
105
|
+
* @param {number} lim_db
|
|
106
|
+
*/
|
|
107
|
+
export function df_set_atten_lim(st, lim_db) {
|
|
108
|
+
wasm.df_set_atten_lim(st, lim_db);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Set DeepFilterNet post filter beta. A beta of 0 disables the post filter.
|
|
113
|
+
*
|
|
114
|
+
* Args:
|
|
115
|
+
* - beta: Post filter attenuation. Suitable range between 0.05 and 0;
|
|
116
|
+
* @param {number} st
|
|
117
|
+
* @param {number} beta
|
|
118
|
+
*/
|
|
119
|
+
export function df_set_post_filter_beta(st, beta) {
|
|
120
|
+
wasm.df_set_post_filter_beta(st, beta);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
let cachedFloat32Memory0 = null;
|
|
124
|
+
|
|
125
|
+
function getFloat32Memory0() {
|
|
126
|
+
if (cachedFloat32Memory0 === null || cachedFloat32Memory0.byteLength === 0) {
|
|
127
|
+
cachedFloat32Memory0 = new Float32Array(wasm.memory.buffer);
|
|
128
|
+
}
|
|
129
|
+
return cachedFloat32Memory0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
133
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
134
|
+
getFloat32Memory0().set(arg, ptr / 4);
|
|
135
|
+
WASM_VECTOR_LEN = arg.length;
|
|
136
|
+
return ptr;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Processes a chunk of samples.
|
|
140
|
+
*
|
|
141
|
+
* Args:
|
|
142
|
+
* - df_state: Created via df_create()
|
|
143
|
+
* - input: Input buffer of length df_get_frame_length()
|
|
144
|
+
* - output: Output buffer of length df_get_frame_length()
|
|
145
|
+
*
|
|
146
|
+
* Returns:
|
|
147
|
+
* - Local SNR of the current frame.
|
|
148
|
+
* @param {number} st
|
|
149
|
+
* @param {Float32Array} input
|
|
150
|
+
* @returns {Float32Array}
|
|
151
|
+
*/
|
|
152
|
+
export function df_process_frame(st, input) {
|
|
153
|
+
const ptr0 = passArrayF32ToWasm0(input, wasm.__wbindgen_malloc);
|
|
154
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155
|
+
const ret = wasm.df_process_frame(st, ptr0, len0);
|
|
156
|
+
return takeObject(ret);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function handleError(f, args) {
|
|
160
|
+
try {
|
|
161
|
+
return f.apply(this, args);
|
|
162
|
+
} catch (e) {
|
|
163
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const DFStateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
168
|
+
? { register: () => {}, unregister: () => {} }
|
|
169
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_dfstate_free(ptr >>> 0));
|
|
170
|
+
/**
|
|
171
|
+
*/
|
|
172
|
+
export class DFState {
|
|
173
|
+
|
|
174
|
+
__destroy_into_raw() {
|
|
175
|
+
const ptr = this.__wbg_ptr;
|
|
176
|
+
this.__wbg_ptr = 0;
|
|
177
|
+
DFStateFinalization.unregister(this);
|
|
178
|
+
return ptr;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
free() {
|
|
182
|
+
const ptr = this.__destroy_into_raw();
|
|
183
|
+
wasm.__wbg_dfstate_free(ptr);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
async function __wbg_load(module, imports) {
|
|
188
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
189
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
190
|
+
try {
|
|
191
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
192
|
+
|
|
193
|
+
} catch (e) {
|
|
194
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
195
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
196
|
+
|
|
197
|
+
} else {
|
|
198
|
+
throw e;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const bytes = await module.arrayBuffer();
|
|
204
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
205
|
+
|
|
206
|
+
} else {
|
|
207
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
208
|
+
|
|
209
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
210
|
+
return { instance, module };
|
|
211
|
+
|
|
212
|
+
} else {
|
|
213
|
+
return instance;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function __wbg_get_imports() {
|
|
219
|
+
const imports = {};
|
|
220
|
+
imports.wbg = {};
|
|
221
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
222
|
+
takeObject(arg0);
|
|
223
|
+
};
|
|
224
|
+
imports.wbg.__wbg_crypto_566d7465cdbb6b7a = function(arg0) {
|
|
225
|
+
const ret = getObject(arg0).crypto;
|
|
226
|
+
return addHeapObject(ret);
|
|
227
|
+
};
|
|
228
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
229
|
+
const val = getObject(arg0);
|
|
230
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
231
|
+
return ret;
|
|
232
|
+
};
|
|
233
|
+
imports.wbg.__wbg_process_dc09a8c7d59982f6 = function(arg0) {
|
|
234
|
+
const ret = getObject(arg0).process;
|
|
235
|
+
return addHeapObject(ret);
|
|
236
|
+
};
|
|
237
|
+
imports.wbg.__wbg_versions_d98c6400c6ca2bd8 = function(arg0) {
|
|
238
|
+
const ret = getObject(arg0).versions;
|
|
239
|
+
return addHeapObject(ret);
|
|
240
|
+
};
|
|
241
|
+
imports.wbg.__wbg_node_caaf83d002149bd5 = function(arg0) {
|
|
242
|
+
const ret = getObject(arg0).node;
|
|
243
|
+
return addHeapObject(ret);
|
|
244
|
+
};
|
|
245
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
246
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
247
|
+
return ret;
|
|
248
|
+
};
|
|
249
|
+
imports.wbg.__wbg_require_94a9da52636aacbf = function() { return handleError(function () {
|
|
250
|
+
const ret = module.require;
|
|
251
|
+
return addHeapObject(ret);
|
|
252
|
+
}, arguments) };
|
|
253
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
254
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
255
|
+
return ret;
|
|
256
|
+
};
|
|
257
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
258
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
259
|
+
return addHeapObject(ret);
|
|
260
|
+
};
|
|
261
|
+
imports.wbg.__wbg_msCrypto_0b84745e9245cdf6 = function(arg0) {
|
|
262
|
+
const ret = getObject(arg0).msCrypto;
|
|
263
|
+
return addHeapObject(ret);
|
|
264
|
+
};
|
|
265
|
+
imports.wbg.__wbg_randomFillSync_290977693942bf03 = function() { return handleError(function (arg0, arg1) {
|
|
266
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
267
|
+
}, arguments) };
|
|
268
|
+
imports.wbg.__wbg_getRandomValues_260cc23a41afad9a = function() { return handleError(function (arg0, arg1) {
|
|
269
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
270
|
+
}, arguments) };
|
|
271
|
+
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
|
272
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
273
|
+
return addHeapObject(ret);
|
|
274
|
+
};
|
|
275
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
276
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
277
|
+
return addHeapObject(ret);
|
|
278
|
+
};
|
|
279
|
+
imports.wbg.__wbg_new_9efabd6b6d2ce46d = function(arg0) {
|
|
280
|
+
const ret = new Float32Array(getObject(arg0));
|
|
281
|
+
return addHeapObject(ret);
|
|
282
|
+
};
|
|
283
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
284
|
+
const ret = getObject(arg0).buffer;
|
|
285
|
+
return addHeapObject(ret);
|
|
286
|
+
};
|
|
287
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
288
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
289
|
+
return addHeapObject(ret);
|
|
290
|
+
};
|
|
291
|
+
imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
292
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
293
|
+
return addHeapObject(ret);
|
|
294
|
+
};
|
|
295
|
+
imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
296
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
297
|
+
};
|
|
298
|
+
imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
|
299
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
300
|
+
return addHeapObject(ret);
|
|
301
|
+
};
|
|
302
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_4a659d079a1650e0 = function(arg0, arg1, arg2) {
|
|
303
|
+
const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
304
|
+
return addHeapObject(ret);
|
|
305
|
+
};
|
|
306
|
+
imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
|
307
|
+
const ret = self.self;
|
|
308
|
+
return addHeapObject(ret);
|
|
309
|
+
}, arguments) };
|
|
310
|
+
imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
|
311
|
+
const ret = window.window;
|
|
312
|
+
return addHeapObject(ret);
|
|
313
|
+
}, arguments) };
|
|
314
|
+
imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
|
315
|
+
const ret = globalThis.globalThis;
|
|
316
|
+
return addHeapObject(ret);
|
|
317
|
+
}, arguments) };
|
|
318
|
+
imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
|
319
|
+
const ret = global.global;
|
|
320
|
+
return addHeapObject(ret);
|
|
321
|
+
}, arguments) };
|
|
322
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
323
|
+
const ret = getObject(arg0) === undefined;
|
|
324
|
+
return ret;
|
|
325
|
+
};
|
|
326
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
|
327
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
328
|
+
return addHeapObject(ret);
|
|
329
|
+
}, arguments) };
|
|
330
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
331
|
+
const ret = getObject(arg0);
|
|
332
|
+
return addHeapObject(ret);
|
|
333
|
+
};
|
|
334
|
+
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
335
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
336
|
+
return addHeapObject(ret);
|
|
337
|
+
}, arguments) };
|
|
338
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
339
|
+
const ret = wasm.memory;
|
|
340
|
+
return addHeapObject(ret);
|
|
341
|
+
};
|
|
342
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
343
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
return imports;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
350
|
+
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function __wbg_finalize_init(instance, module) {
|
|
354
|
+
wasm = instance.exports;
|
|
355
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
356
|
+
cachedFloat32Memory0 = null;
|
|
357
|
+
cachedUint8Memory0 = null;
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
return wasm;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function initSync(module) {
|
|
364
|
+
if (wasm !== undefined) return wasm;
|
|
365
|
+
|
|
366
|
+
const imports = __wbg_get_imports();
|
|
367
|
+
|
|
368
|
+
__wbg_init_memory(imports);
|
|
369
|
+
|
|
370
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
371
|
+
module = new WebAssembly.Module(module);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
375
|
+
|
|
376
|
+
return __wbg_finalize_init(instance, module);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
async function __wbg_init(input) {
|
|
380
|
+
if (wasm !== undefined) return wasm;
|
|
381
|
+
|
|
382
|
+
if (typeof input === 'undefined') {
|
|
383
|
+
input = new URL('df_bg.wasm', import.meta.url);
|
|
384
|
+
}
|
|
385
|
+
const imports = __wbg_get_imports();
|
|
386
|
+
|
|
387
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
388
|
+
input = fetch(input);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
__wbg_init_memory(imports);
|
|
392
|
+
|
|
393
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
394
|
+
|
|
395
|
+
return __wbg_finalize_init(instance, module);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export { initSync }
|
|
399
|
+
export default __wbg_init;
|
package/pkg/df_bg.wasm
CHANGED
|
Binary file
|