@sidevoice/engine 0.0.0 → 0.3.1
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/LICENSE +202 -0
- package/README.md +60 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/dist/sidevoice_engine.d.ts +443 -0
- package/dist/sidevoice_engine.js +1660 -0
- package/dist/sidevoice_engine_bg.wasm +0 -0
- package/dist/sidevoice_engine_bg.wasm.d.ts +73 -0
- package/dist/snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline0.js +1 -0
- package/dist/snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline1.js +1 -0
- package/dist/snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline2.js +21 -0
- package/dist/snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline3.js +33 -0
- package/dist/snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline4.js +8 -0
- package/dist/snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline5.js +5 -0
- package/dist/snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline6.js +7 -0
- package/package.json +31 -3
|
@@ -0,0 +1,1660 @@
|
|
|
1
|
+
/* @ts-self-types="./sidevoice_engine.d.ts" */
|
|
2
|
+
import { importEspeak } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline0.js';
|
|
3
|
+
import { importTransformers } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline1.js';
|
|
4
|
+
import { detectLanguage } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline2.js';
|
|
5
|
+
import { serve } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline3.js';
|
|
6
|
+
import { smartTurnRun } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline5.js';
|
|
7
|
+
import { sileroRun } from './snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline6.js';
|
|
8
|
+
import * as import1 from "./snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline4.js"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A model, local or remote, as an end-of-turn classifier.
|
|
13
|
+
*/
|
|
14
|
+
export class EndOfTurn {
|
|
15
|
+
static __wrap(ptr) {
|
|
16
|
+
const obj = Object.create(EndOfTurn.prototype);
|
|
17
|
+
obj.__wbg_ptr = ptr;
|
|
18
|
+
EndOfTurnFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
19
|
+
return obj;
|
|
20
|
+
}
|
|
21
|
+
__destroy_into_raw() {
|
|
22
|
+
const ptr = this.__wbg_ptr;
|
|
23
|
+
this.__wbg_ptr = 0;
|
|
24
|
+
EndOfTurnFinalization.unregister(this);
|
|
25
|
+
return ptr;
|
|
26
|
+
}
|
|
27
|
+
free() {
|
|
28
|
+
const ptr = this.__destroy_into_raw();
|
|
29
|
+
wasm.__wbg_endofturn_free(ptr, 0);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The probability, from 0 to 1, that the turn in `audio` (mono samples at `sampleRate` Hz, from its start to now)
|
|
33
|
+
* is complete; the engine keeps the last `seconds` and resamples them.
|
|
34
|
+
* @param {Float32Array} audio
|
|
35
|
+
* @param {number} sampleRate
|
|
36
|
+
* @returns {Promise<number>}
|
|
37
|
+
*/
|
|
38
|
+
probability(audio, sampleRate) {
|
|
39
|
+
const ptr0 = passArrayF32ToWasm0(audio, wasm.__wbindgen_malloc_command_export);
|
|
40
|
+
const len0 = WASM_VECTOR_LEN;
|
|
41
|
+
const ret = wasm.endofturn_probability(this.__wbg_ptr, ptr0, len0, sampleRate);
|
|
42
|
+
return ret;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* How many seconds of the end of a turn the model hears: earlier audio does not count.
|
|
46
|
+
* @returns {number}
|
|
47
|
+
*/
|
|
48
|
+
get seconds() {
|
|
49
|
+
const ret = wasm.endofturn_seconds(this.__wbg_ptr);
|
|
50
|
+
return ret >>> 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (Symbol.dispose) EndOfTurn.prototype[Symbol.dispose] = EndOfTurn.prototype.free;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The local catalogue, for JavaScript.
|
|
57
|
+
*/
|
|
58
|
+
export class LocalCatalog {
|
|
59
|
+
static __wrap(ptr) {
|
|
60
|
+
const obj = Object.create(LocalCatalog.prototype);
|
|
61
|
+
obj.__wbg_ptr = ptr;
|
|
62
|
+
LocalCatalogFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
63
|
+
return obj;
|
|
64
|
+
}
|
|
65
|
+
__destroy_into_raw() {
|
|
66
|
+
const ptr = this.__wbg_ptr;
|
|
67
|
+
this.__wbg_ptr = 0;
|
|
68
|
+
LocalCatalogFinalization.unregister(this);
|
|
69
|
+
return ptr;
|
|
70
|
+
}
|
|
71
|
+
free() {
|
|
72
|
+
const ptr = this.__destroy_into_raw();
|
|
73
|
+
wasm.__wbg_localcatalog_free(ptr, 0);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Its id: `"local"`.
|
|
77
|
+
* @returns {string}
|
|
78
|
+
*/
|
|
79
|
+
get id() {
|
|
80
|
+
let deferred1_0;
|
|
81
|
+
let deferred1_1;
|
|
82
|
+
try {
|
|
83
|
+
const ret = wasm.localcatalog_id(this.__wbg_ptr);
|
|
84
|
+
deferred1_0 = ret[0];
|
|
85
|
+
deferred1_1 = ret[1];
|
|
86
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
87
|
+
} finally {
|
|
88
|
+
wasm.__wbindgen_free_command_export(deferred1_0, deferred1_1, 1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The model `model`, loaded as `WebEngine.load` does with no build (installing it first and telling
|
|
93
|
+
* `onProgress`; `signal` aborts it).
|
|
94
|
+
* @param {string} model
|
|
95
|
+
* @param {(progress: Progress) => void} onProgress
|
|
96
|
+
* @param {AbortSignal | null} [signal]
|
|
97
|
+
* @returns {Promise<LocalModel>}
|
|
98
|
+
*/
|
|
99
|
+
load(model, onProgress, signal) {
|
|
100
|
+
const ptr0 = passStringToWasm0(model, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
101
|
+
const len0 = WASM_VECTOR_LEN;
|
|
102
|
+
const ret = wasm.localcatalog_load(this.__wbg_ptr, ptr0, len0, isLikeNone(onProgress) ? 0 : addToExternrefTable0(onProgress), isLikeNone(signal) ? 0 : addToExternrefTable0(signal));
|
|
103
|
+
return ret;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Its models, those of `capability` alone when given (`"stt"`, `"tts"`, `"vad"`, `"end-of-turn"`), each with its
|
|
107
|
+
* builds ranked and what is installed; rejects with `invalid-capability` for any other.
|
|
108
|
+
* @param {"stt" | "tts" | "vad" | "end-of-turn"} capability
|
|
109
|
+
* @returns {Promise<LocalModelInfo[]>}
|
|
110
|
+
*/
|
|
111
|
+
models(capability) {
|
|
112
|
+
var ptr0 = isLikeNone(capability) ? 0 : passStringToWasm0(capability, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
113
|
+
var len0 = WASM_VECTOR_LEN;
|
|
114
|
+
const ret = wasm.localcatalog_models(this.__wbg_ptr, ptr0, len0);
|
|
115
|
+
return ret;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Absent: the app names the local catalogue.
|
|
119
|
+
* @returns {string | undefined}
|
|
120
|
+
*/
|
|
121
|
+
get name() {
|
|
122
|
+
const ret = wasm.localcatalog_name(this.__wbg_ptr);
|
|
123
|
+
let v1;
|
|
124
|
+
if (ret[0] !== 0) {
|
|
125
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
126
|
+
wasm.__wbindgen_free_command_export(ret[0], ret[1] * 1, 1);
|
|
127
|
+
}
|
|
128
|
+
return v1;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Nothing to read again: compiled in. Its status.
|
|
132
|
+
* @returns {Promise<CatalogStatus>}
|
|
133
|
+
*/
|
|
134
|
+
refresh() {
|
|
135
|
+
const ret = wasm.localcatalog_refresh(this.__wbg_ptr);
|
|
136
|
+
return ret;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* How it stands: always current.
|
|
140
|
+
* @returns {Promise<CatalogStatus>}
|
|
141
|
+
*/
|
|
142
|
+
status() {
|
|
143
|
+
const ret = wasm.localcatalog_status(this.__wbg_ptr);
|
|
144
|
+
return ret;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (Symbol.dispose) LocalCatalog.prototype[Symbol.dispose] = LocalCatalog.prototype.free;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* A local model in memory, for JavaScript. It and the `Stt` and `Tts` it hands out each keep the model in memory:
|
|
151
|
+
* freeing them all (`free()`, or letting them be collected) unloads it.
|
|
152
|
+
*/
|
|
153
|
+
export class LocalModel {
|
|
154
|
+
static __wrap(ptr) {
|
|
155
|
+
const obj = Object.create(LocalModel.prototype);
|
|
156
|
+
obj.__wbg_ptr = ptr;
|
|
157
|
+
LocalModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
158
|
+
return obj;
|
|
159
|
+
}
|
|
160
|
+
__destroy_into_raw() {
|
|
161
|
+
const ptr = this.__wbg_ptr;
|
|
162
|
+
this.__wbg_ptr = 0;
|
|
163
|
+
LocalModelFinalization.unregister(this);
|
|
164
|
+
return ptr;
|
|
165
|
+
}
|
|
166
|
+
free() {
|
|
167
|
+
const ptr = this.__destroy_into_raw();
|
|
168
|
+
wasm.__wbg_localmodel_free(ptr, 0);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The model as an end-of-turn classifier, if it is one.
|
|
172
|
+
* @returns {EndOfTurn | undefined}
|
|
173
|
+
*/
|
|
174
|
+
asEndOfTurn() {
|
|
175
|
+
const ret = wasm.localmodel_asEndOfTurn(this.__wbg_ptr);
|
|
176
|
+
return ret === 0 ? undefined : EndOfTurn.__wrap(ret);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The model as speech to text, if it is one.
|
|
180
|
+
* @returns {Stt | undefined}
|
|
181
|
+
*/
|
|
182
|
+
asStt() {
|
|
183
|
+
const ret = wasm.localmodel_asStt(this.__wbg_ptr);
|
|
184
|
+
return ret === 0 ? undefined : Stt.__wrap(ret);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The model as text to speech, if it is one.
|
|
188
|
+
* @returns {Tts | undefined}
|
|
189
|
+
*/
|
|
190
|
+
asTts() {
|
|
191
|
+
const ret = wasm.localmodel_asTts(this.__wbg_ptr);
|
|
192
|
+
return ret === 0 ? undefined : Tts.__wrap(ret);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The model as a voice activity detector, if it is one.
|
|
196
|
+
* @returns {Vad | undefined}
|
|
197
|
+
*/
|
|
198
|
+
asVad() {
|
|
199
|
+
const ret = wasm.localmodel_asVad(this.__wbg_ptr);
|
|
200
|
+
return ret === 0 ? undefined : Vad.__wrap(ret);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The id of the build that was loaded.
|
|
204
|
+
* @returns {string}
|
|
205
|
+
*/
|
|
206
|
+
get build() {
|
|
207
|
+
let deferred1_0;
|
|
208
|
+
let deferred1_1;
|
|
209
|
+
try {
|
|
210
|
+
const ret = wasm.localmodel_build(this.__wbg_ptr);
|
|
211
|
+
deferred1_0 = ret[0];
|
|
212
|
+
deferred1_1 = ret[1];
|
|
213
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
214
|
+
} finally {
|
|
215
|
+
wasm.__wbindgen_free_command_export(deferred1_0, deferred1_1, 1);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* What it can do: `"stt"`, `"tts"`, `"vad"`, `"end-of-turn"`.
|
|
220
|
+
* @returns {("stt" | "tts" | "vad" | "end-of-turn")[]}
|
|
221
|
+
*/
|
|
222
|
+
capabilities() {
|
|
223
|
+
const ret = wasm.localmodel_capabilities(this.__wbg_ptr);
|
|
224
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
225
|
+
wasm.__wbindgen_free_command_export(ret[0], ret[1] * 4, 4);
|
|
226
|
+
return v1;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The model's id.
|
|
230
|
+
* @returns {string}
|
|
231
|
+
*/
|
|
232
|
+
get id() {
|
|
233
|
+
let deferred1_0;
|
|
234
|
+
let deferred1_1;
|
|
235
|
+
try {
|
|
236
|
+
const ret = wasm.localmodel_id(this.__wbg_ptr);
|
|
237
|
+
deferred1_0 = ret[0];
|
|
238
|
+
deferred1_1 = ret[1];
|
|
239
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
240
|
+
} finally {
|
|
241
|
+
wasm.__wbindgen_free_command_export(deferred1_0, deferred1_1, 1);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (Symbol.dispose) LocalModel.prototype[Symbol.dispose] = LocalModel.prototype.free;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* A remote provider's catalogue, for JavaScript.
|
|
249
|
+
*/
|
|
250
|
+
export class RemoteCatalog {
|
|
251
|
+
static __wrap(ptr) {
|
|
252
|
+
const obj = Object.create(RemoteCatalog.prototype);
|
|
253
|
+
obj.__wbg_ptr = ptr;
|
|
254
|
+
RemoteCatalogFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
255
|
+
return obj;
|
|
256
|
+
}
|
|
257
|
+
__destroy_into_raw() {
|
|
258
|
+
const ptr = this.__wbg_ptr;
|
|
259
|
+
this.__wbg_ptr = 0;
|
|
260
|
+
RemoteCatalogFinalization.unregister(this);
|
|
261
|
+
return ptr;
|
|
262
|
+
}
|
|
263
|
+
free() {
|
|
264
|
+
const ptr = this.__destroy_into_raw();
|
|
265
|
+
wasm.__wbg_remotecatalog_free(ptr, 0);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Its id: the provider's.
|
|
269
|
+
* @returns {string}
|
|
270
|
+
*/
|
|
271
|
+
get id() {
|
|
272
|
+
let deferred1_0;
|
|
273
|
+
let deferred1_1;
|
|
274
|
+
try {
|
|
275
|
+
const ret = wasm.remotecatalog_id(this.__wbg_ptr);
|
|
276
|
+
deferred1_0 = ret[0];
|
|
277
|
+
deferred1_1 = ret[1];
|
|
278
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
279
|
+
} finally {
|
|
280
|
+
wasm.__wbindgen_free_command_export(deferred1_0, deferred1_1, 1);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* The model `model`, as listed: it calls the provider each time it is used. `onProgress` is never called (nothing
|
|
285
|
+
* is installed); `signal` aborts it.
|
|
286
|
+
* @param {string} model
|
|
287
|
+
* @param {(progress: Progress) => void} onProgress
|
|
288
|
+
* @param {AbortSignal | null} [signal]
|
|
289
|
+
* @returns {Promise<RemoteModel>}
|
|
290
|
+
*/
|
|
291
|
+
load(model, onProgress, signal) {
|
|
292
|
+
const ptr0 = passStringToWasm0(model, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
293
|
+
const len0 = WASM_VECTOR_LEN;
|
|
294
|
+
const ret = wasm.remotecatalog_load(this.__wbg_ptr, ptr0, len0, isLikeNone(onProgress) ? 0 : addToExternrefTable0(onProgress), isLikeNone(signal) ? 0 : addToExternrefTable0(signal));
|
|
295
|
+
return ret;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Its models as listed, those of `capability` alone when given; rejects with `invalid-capability` for any other.
|
|
299
|
+
* @param {"stt" | "tts" | "vad" | "end-of-turn"} capability
|
|
300
|
+
* @returns {Promise<RemoteModelInfo[]>}
|
|
301
|
+
*/
|
|
302
|
+
models(capability) {
|
|
303
|
+
var ptr0 = isLikeNone(capability) ? 0 : passStringToWasm0(capability, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
304
|
+
var len0 = WASM_VECTOR_LEN;
|
|
305
|
+
const ret = wasm.remotecatalog_models(this.__wbg_ptr, ptr0, len0);
|
|
306
|
+
return ret;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* The provider's name ("OpenAI").
|
|
310
|
+
* @returns {string | undefined}
|
|
311
|
+
*/
|
|
312
|
+
get name() {
|
|
313
|
+
const ret = wasm.remotecatalog_name(this.__wbg_ptr);
|
|
314
|
+
let v1;
|
|
315
|
+
if (ret[0] !== 0) {
|
|
316
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
317
|
+
wasm.__wbindgen_free_command_export(ret[0], ret[1] * 1, 1);
|
|
318
|
+
}
|
|
319
|
+
return v1;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Reads it again now, whatever its age: its status after.
|
|
323
|
+
* @returns {Promise<CatalogStatus>}
|
|
324
|
+
*/
|
|
325
|
+
refresh() {
|
|
326
|
+
const ret = wasm.remotecatalog_refresh(this.__wbg_ptr);
|
|
327
|
+
return ret;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* How it stands: `{ reason?, stale, detail? }`, listing the provider first if its listing is missing or old.
|
|
331
|
+
* @returns {Promise<CatalogStatus>}
|
|
332
|
+
*/
|
|
333
|
+
status() {
|
|
334
|
+
const ret = wasm.remotecatalog_status(this.__wbg_ptr);
|
|
335
|
+
return ret;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (Symbol.dispose) RemoteCatalog.prototype[Symbol.dispose] = RemoteCatalog.prototype.free;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* A remote provider's model, for JavaScript: each call on what it hands out goes to the provider.
|
|
342
|
+
*/
|
|
343
|
+
export class RemoteModel {
|
|
344
|
+
static __wrap(ptr) {
|
|
345
|
+
const obj = Object.create(RemoteModel.prototype);
|
|
346
|
+
obj.__wbg_ptr = ptr;
|
|
347
|
+
RemoteModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
348
|
+
return obj;
|
|
349
|
+
}
|
|
350
|
+
__destroy_into_raw() {
|
|
351
|
+
const ptr = this.__wbg_ptr;
|
|
352
|
+
this.__wbg_ptr = 0;
|
|
353
|
+
RemoteModelFinalization.unregister(this);
|
|
354
|
+
return ptr;
|
|
355
|
+
}
|
|
356
|
+
free() {
|
|
357
|
+
const ptr = this.__destroy_into_raw();
|
|
358
|
+
wasm.__wbg_remotemodel_free(ptr, 0);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* The model as an end-of-turn classifier, if it is one.
|
|
362
|
+
* @returns {EndOfTurn | undefined}
|
|
363
|
+
*/
|
|
364
|
+
asEndOfTurn() {
|
|
365
|
+
const ret = wasm.remotemodel_asEndOfTurn(this.__wbg_ptr);
|
|
366
|
+
return ret === 0 ? undefined : EndOfTurn.__wrap(ret);
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* The model as speech to text, if it is one.
|
|
370
|
+
* @returns {Stt | undefined}
|
|
371
|
+
*/
|
|
372
|
+
asStt() {
|
|
373
|
+
const ret = wasm.remotemodel_asStt(this.__wbg_ptr);
|
|
374
|
+
return ret === 0 ? undefined : Stt.__wrap(ret);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* The model as text to speech, if it is one.
|
|
378
|
+
* @returns {Tts | undefined}
|
|
379
|
+
*/
|
|
380
|
+
asTts() {
|
|
381
|
+
const ret = wasm.remotemodel_asTts(this.__wbg_ptr);
|
|
382
|
+
return ret === 0 ? undefined : Tts.__wrap(ret);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* The model as a voice activity detector, if it is one.
|
|
386
|
+
* @returns {Vad | undefined}
|
|
387
|
+
*/
|
|
388
|
+
asVad() {
|
|
389
|
+
const ret = wasm.remotemodel_asVad(this.__wbg_ptr);
|
|
390
|
+
return ret === 0 ? undefined : Vad.__wrap(ret);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* What it can do: `"stt"`, `"tts"`, `"vad"`, `"end-of-turn"`.
|
|
394
|
+
* @returns {("stt" | "tts" | "vad" | "end-of-turn")[]}
|
|
395
|
+
*/
|
|
396
|
+
capabilities() {
|
|
397
|
+
const ret = wasm.remotemodel_capabilities(this.__wbg_ptr);
|
|
398
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
399
|
+
wasm.__wbindgen_free_command_export(ret[0], ret[1] * 4, 4);
|
|
400
|
+
return v1;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* The provider's id of the model.
|
|
404
|
+
* @returns {string}
|
|
405
|
+
*/
|
|
406
|
+
get id() {
|
|
407
|
+
let deferred1_0;
|
|
408
|
+
let deferred1_1;
|
|
409
|
+
try {
|
|
410
|
+
const ret = wasm.remotemodel_id(this.__wbg_ptr);
|
|
411
|
+
deferred1_0 = ret[0];
|
|
412
|
+
deferred1_1 = ret[1];
|
|
413
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
414
|
+
} finally {
|
|
415
|
+
wasm.__wbindgen_free_command_export(deferred1_0, deferred1_1, 1);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* The provider's id.
|
|
420
|
+
* @returns {string}
|
|
421
|
+
*/
|
|
422
|
+
get provider() {
|
|
423
|
+
let deferred1_0;
|
|
424
|
+
let deferred1_1;
|
|
425
|
+
try {
|
|
426
|
+
const ret = wasm.remotemodel_provider(this.__wbg_ptr);
|
|
427
|
+
deferred1_0 = ret[0];
|
|
428
|
+
deferred1_1 = ret[1];
|
|
429
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
430
|
+
} finally {
|
|
431
|
+
wasm.__wbindgen_free_command_export(deferred1_0, deferred1_1, 1);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (Symbol.dispose) RemoteModel.prototype[Symbol.dispose] = RemoteModel.prototype.free;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* A model, local or remote, as speech to text.
|
|
439
|
+
*/
|
|
440
|
+
export class Stt {
|
|
441
|
+
static __wrap(ptr) {
|
|
442
|
+
const obj = Object.create(Stt.prototype);
|
|
443
|
+
obj.__wbg_ptr = ptr;
|
|
444
|
+
SttFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
445
|
+
return obj;
|
|
446
|
+
}
|
|
447
|
+
__destroy_into_raw() {
|
|
448
|
+
const ptr = this.__wbg_ptr;
|
|
449
|
+
this.__wbg_ptr = 0;
|
|
450
|
+
SttFinalization.unregister(this);
|
|
451
|
+
return ptr;
|
|
452
|
+
}
|
|
453
|
+
free() {
|
|
454
|
+
const ptr = this.__destroy_into_raw();
|
|
455
|
+
wasm.__wbg_stt_free(ptr, 0);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* What is said in `audio` (mono samples at `sampleRate` Hz, one whole turn; the engine resamples it), in
|
|
459
|
+
* `language` (a BCP 47 tag), or in the one the model detects when left out.
|
|
460
|
+
* @param {Float32Array} audio
|
|
461
|
+
* @param {number} sampleRate
|
|
462
|
+
* @param {string | null} [language]
|
|
463
|
+
* @returns {Promise<string>}
|
|
464
|
+
*/
|
|
465
|
+
transcribe(audio, sampleRate, language) {
|
|
466
|
+
const ptr0 = passArrayF32ToWasm0(audio, wasm.__wbindgen_malloc_command_export);
|
|
467
|
+
const len0 = WASM_VECTOR_LEN;
|
|
468
|
+
var ptr1 = isLikeNone(language) ? 0 : passStringToWasm0(language, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
469
|
+
var len1 = WASM_VECTOR_LEN;
|
|
470
|
+
const ret = wasm.stt_transcribe(this.__wbg_ptr, ptr0, len0, sampleRate, ptr1, len1);
|
|
471
|
+
return ret;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
if (Symbol.dispose) Stt.prototype[Symbol.dispose] = Stt.prototype.free;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* A model, local or remote, as text to speech.
|
|
478
|
+
*/
|
|
479
|
+
export class Tts {
|
|
480
|
+
static __wrap(ptr) {
|
|
481
|
+
const obj = Object.create(Tts.prototype);
|
|
482
|
+
obj.__wbg_ptr = ptr;
|
|
483
|
+
TtsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
484
|
+
return obj;
|
|
485
|
+
}
|
|
486
|
+
__destroy_into_raw() {
|
|
487
|
+
const ptr = this.__wbg_ptr;
|
|
488
|
+
this.__wbg_ptr = 0;
|
|
489
|
+
TtsFinalization.unregister(this);
|
|
490
|
+
return ptr;
|
|
491
|
+
}
|
|
492
|
+
free() {
|
|
493
|
+
const ptr = this.__destroy_into_raw();
|
|
494
|
+
wasm.__wbg_tts_free(ptr, 0);
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* `text` spoken with `voice` (one of `voices()`), in `language` (a BCP 47 tag) for a model that speaks several,
|
|
498
|
+
* at `speed` (1 when left out): `{ samples, sampleRate }`, at the model's own rate.
|
|
499
|
+
* @param {string} text
|
|
500
|
+
* @param {string} voice
|
|
501
|
+
* @param {string | null} [language]
|
|
502
|
+
* @param {number | null} [speed]
|
|
503
|
+
* @returns {Promise<Audio>}
|
|
504
|
+
*/
|
|
505
|
+
speak(text, voice, language, speed) {
|
|
506
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
507
|
+
const len0 = WASM_VECTOR_LEN;
|
|
508
|
+
const ptr1 = passStringToWasm0(voice, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
509
|
+
const len1 = WASM_VECTOR_LEN;
|
|
510
|
+
var ptr2 = isLikeNone(language) ? 0 : passStringToWasm0(language, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
511
|
+
var len2 = WASM_VECTOR_LEN;
|
|
512
|
+
const ret = wasm.tts_speak(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(speed) ? Number.MAX_SAFE_INTEGER : Math.fround(speed));
|
|
513
|
+
return ret;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* The voices it speaks with: `{ id, languages, gender? }`.
|
|
517
|
+
* @returns {Promise<Voice[]>}
|
|
518
|
+
*/
|
|
519
|
+
voices() {
|
|
520
|
+
const ret = wasm.tts_voices(this.__wbg_ptr);
|
|
521
|
+
return ret;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if (Symbol.dispose) Tts.prototype[Symbol.dispose] = Tts.prototype.free;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* A model, local or remote, as a voice activity detector.
|
|
528
|
+
*/
|
|
529
|
+
export class Vad {
|
|
530
|
+
static __wrap(ptr) {
|
|
531
|
+
const obj = Object.create(Vad.prototype);
|
|
532
|
+
obj.__wbg_ptr = ptr;
|
|
533
|
+
VadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
534
|
+
return obj;
|
|
535
|
+
}
|
|
536
|
+
__destroy_into_raw() {
|
|
537
|
+
const ptr = this.__wbg_ptr;
|
|
538
|
+
this.__wbg_ptr = 0;
|
|
539
|
+
VadFinalization.unregister(this);
|
|
540
|
+
return ptr;
|
|
541
|
+
}
|
|
542
|
+
free() {
|
|
543
|
+
const ptr = this.__destroy_into_raw();
|
|
544
|
+
wasm.__wbg_vad_free(ptr, 0);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* A new stream, from sample 0 and with no speech, deciding with `options` (each left out takes its default).
|
|
548
|
+
* Rejects with `invalid-vad-options` for options out of their bounds or of the wrong type.
|
|
549
|
+
* @param {VadOptions} options
|
|
550
|
+
* @returns {Promise<VadStream>}
|
|
551
|
+
*/
|
|
552
|
+
stream(options) {
|
|
553
|
+
const ret = wasm.vad_stream(this.__wbg_ptr, isLikeNone(options) ? 0 : addToExternrefTable0(options));
|
|
554
|
+
return ret;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (Symbol.dispose) Vad.prototype[Symbol.dispose] = Vad.prototype.free;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* One stream of audio through a voice activity detector: feed it mono samples at `sampleRate` as they come, in pieces
|
|
561
|
+
* of any length. It keeps the model in memory until it is freed. Calls on it wait for one another.
|
|
562
|
+
*/
|
|
563
|
+
export class VadStream {
|
|
564
|
+
static __wrap(ptr) {
|
|
565
|
+
const obj = Object.create(VadStream.prototype);
|
|
566
|
+
obj.__wbg_ptr = ptr;
|
|
567
|
+
VadStreamFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
568
|
+
return obj;
|
|
569
|
+
}
|
|
570
|
+
__destroy_into_raw() {
|
|
571
|
+
const ptr = this.__wbg_ptr;
|
|
572
|
+
this.__wbg_ptr = 0;
|
|
573
|
+
VadStreamFinalization.unregister(this);
|
|
574
|
+
return ptr;
|
|
575
|
+
}
|
|
576
|
+
free() {
|
|
577
|
+
const ptr = this.__destroy_into_raw();
|
|
578
|
+
wasm.__wbg_vadstream_free(ptr, 0);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Takes the next `samples` and runs the model on every whole window it now has: `{ frames, events }`.
|
|
582
|
+
* @param {Float32Array} samples
|
|
583
|
+
* @returns {Promise<VadOutput>}
|
|
584
|
+
*/
|
|
585
|
+
accept(samples) {
|
|
586
|
+
const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc_command_export);
|
|
587
|
+
const len0 = WASM_VECTOR_LEN;
|
|
588
|
+
const ret = wasm.vadstream_accept(this.__wbg_ptr, ptr0, len0);
|
|
589
|
+
return ret;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Ends the stream's audio: the speech in progress, if any, as its `speech-end` event (else `undefined`); the
|
|
593
|
+
* stream then starts over from sample 0.
|
|
594
|
+
* @returns {Promise<VadEvent | undefined>}
|
|
595
|
+
*/
|
|
596
|
+
finish() {
|
|
597
|
+
const ret = wasm.vadstream_finish(this.__wbg_ptr);
|
|
598
|
+
return ret;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Starts over from sample 0, forgetting any speech in progress.
|
|
602
|
+
* @returns {Promise<void>}
|
|
603
|
+
*/
|
|
604
|
+
reset() {
|
|
605
|
+
const ret = wasm.vadstream_reset(this.__wbg_ptr);
|
|
606
|
+
return ret;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* The rate the stream takes, in Hz: the model's own. It is not resampled.
|
|
610
|
+
* @returns {number}
|
|
611
|
+
*/
|
|
612
|
+
get sampleRate() {
|
|
613
|
+
const ret = wasm.vadstream_sampleRate(this.__wbg_ptr);
|
|
614
|
+
return ret >>> 0;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* How many samples one window, one frame, holds.
|
|
618
|
+
* @returns {number}
|
|
619
|
+
*/
|
|
620
|
+
get window() {
|
|
621
|
+
const ret = wasm.vadstream_window(this.__wbg_ptr);
|
|
622
|
+
return ret >>> 0;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
if (Symbol.dispose) VadStream.prototype[Symbol.dispose] = VadStream.prototype.free;
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* The engine, for JavaScript.
|
|
629
|
+
*/
|
|
630
|
+
export class WebEngine {
|
|
631
|
+
static __wrap(ptr) {
|
|
632
|
+
const obj = Object.create(WebEngine.prototype);
|
|
633
|
+
obj.__wbg_ptr = ptr;
|
|
634
|
+
WebEngineFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
635
|
+
return obj;
|
|
636
|
+
}
|
|
637
|
+
__destroy_into_raw() {
|
|
638
|
+
const ptr = this.__wbg_ptr;
|
|
639
|
+
this.__wbg_ptr = 0;
|
|
640
|
+
WebEngineFinalization.unregister(this);
|
|
641
|
+
return ptr;
|
|
642
|
+
}
|
|
643
|
+
free() {
|
|
644
|
+
const ptr = this.__destroy_into_raw();
|
|
645
|
+
wasm.__wbg_webengine_free(ptr, 0);
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* The ids of the backends in this build.
|
|
649
|
+
* @returns {string[]}
|
|
650
|
+
*/
|
|
651
|
+
backends() {
|
|
652
|
+
const ret = wasm.webengine_backends(this.__wbg_ptr);
|
|
653
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
654
|
+
wasm.__wbindgen_free_command_export(ret[0], ret[1] * 4, 4);
|
|
655
|
+
return v1;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* The catalogue `id` (`"local"`, `"openai"`, `"elevenlabs"`); throws `catalog-not-found` for any other.
|
|
659
|
+
* @param {string} id
|
|
660
|
+
* @returns {LocalCatalog | RemoteCatalog}
|
|
661
|
+
*/
|
|
662
|
+
catalog(id) {
|
|
663
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
664
|
+
const len0 = WASM_VECTOR_LEN;
|
|
665
|
+
const ret = wasm.webengine_catalog(this.__wbg_ptr, ptr0, len0);
|
|
666
|
+
if (ret[2]) {
|
|
667
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
668
|
+
}
|
|
669
|
+
return takeFromExternrefTable0(ret[0]);
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Every catalogue of this engine: the `LocalCatalog` first, then each provider's `RemoteCatalog`, by id. Both have
|
|
673
|
+
* `id`, `name`, `status()`, `models(capability?)`, `refresh()` and `load(model)`; each lists and loads its own
|
|
674
|
+
* types.
|
|
675
|
+
* @returns {(LocalCatalog | RemoteCatalog)[]}
|
|
676
|
+
*/
|
|
677
|
+
catalogs() {
|
|
678
|
+
const ret = wasm.webengine_catalogs(this.__wbg_ptr);
|
|
679
|
+
return ret;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Asks the host for its capabilities once, and builds the engine on the bundled catalogue. The host may also have
|
|
683
|
+
* `credential(provider)`, which returns (or resolves to) the key of a remote provider (`"openai"`, `"elevenlabs"`)
|
|
684
|
+
* or `null`: the engine asks it each time a provider is listed or a remote model called, and keeps no key.
|
|
685
|
+
* Rejects with `host-capabilities` when the host's `capabilities()` fails, `host-capabilities-<field>` when what it
|
|
686
|
+
* reports is malformed.
|
|
687
|
+
* @param {any} host
|
|
688
|
+
* @returns {Promise<WebEngine>}
|
|
689
|
+
*/
|
|
690
|
+
static create(host) {
|
|
691
|
+
const ret = wasm.webengine_create(host);
|
|
692
|
+
return ret;
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Installs `build` of `model` (the recommended one when left out), telling `onProgress` as it goes; `signal`
|
|
696
|
+
* aborts it, and the promise rejects with `cancelled`, leaving nothing half downloaded.
|
|
697
|
+
* @param {string} model
|
|
698
|
+
* @param {string | null | undefined} build
|
|
699
|
+
* @param {(progress: Progress) => void} onProgress
|
|
700
|
+
* @param {AbortSignal | null} [signal]
|
|
701
|
+
* @returns {Promise<void>}
|
|
702
|
+
*/
|
|
703
|
+
install(model, build, onProgress, signal) {
|
|
704
|
+
const ptr0 = passStringToWasm0(model, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
705
|
+
const len0 = WASM_VECTOR_LEN;
|
|
706
|
+
var ptr1 = isLikeNone(build) ? 0 : passStringToWasm0(build, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
707
|
+
var len1 = WASM_VECTOR_LEN;
|
|
708
|
+
const ret = wasm.webengine_install(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(onProgress) ? 0 : addToExternrefTable0(onProgress), isLikeNone(signal) ? 0 : addToExternrefTable0(signal));
|
|
709
|
+
return ret;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Loads `build` of `model` (an installed one that runs here, else the recommended one, when left out),
|
|
713
|
+
* installing it first if it is not, as [`WebEngine::install`] does. The model stays in memory while a
|
|
714
|
+
* `LocalModel` of its build lives, or an `Stt` or `Tts` one handed out: freeing them all (`free()`, or letting
|
|
715
|
+
* them be collected) unloads it.
|
|
716
|
+
* @param {string} model
|
|
717
|
+
* @param {string | null | undefined} build
|
|
718
|
+
* @param {(progress: Progress) => void} onProgress
|
|
719
|
+
* @param {AbortSignal | null} [signal]
|
|
720
|
+
* @returns {Promise<LocalModel>}
|
|
721
|
+
*/
|
|
722
|
+
load(model, build, onProgress, signal) {
|
|
723
|
+
const ptr0 = passStringToWasm0(model, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
724
|
+
const len0 = WASM_VECTOR_LEN;
|
|
725
|
+
var ptr1 = isLikeNone(build) ? 0 : passStringToWasm0(build, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
726
|
+
var len1 = WASM_VECTOR_LEN;
|
|
727
|
+
const ret = wasm.webengine_load(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(onProgress) ? 0 : addToExternrefTable0(onProgress), isLikeNone(signal) ? 0 : addToExternrefTable0(signal));
|
|
728
|
+
return ret;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* The local catalogue: its models are `LocalModelInfo`s (builds, install state) and it loads `LocalModel`s.
|
|
732
|
+
* @returns {LocalCatalog}
|
|
733
|
+
*/
|
|
734
|
+
localCatalog() {
|
|
735
|
+
const ret = wasm.webengine_localCatalog(this.__wbg_ptr);
|
|
736
|
+
return LocalCatalog.__wrap(ret);
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* The remote provider `id`: its models are `RemoteModelInfo`s and it loads `RemoteModel`s; throws
|
|
740
|
+
* `catalog-not-found` for an id that is no provider.
|
|
741
|
+
* @param {string} id
|
|
742
|
+
* @returns {RemoteCatalog}
|
|
743
|
+
*/
|
|
744
|
+
remoteCatalog(id) {
|
|
745
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
746
|
+
const len0 = WASM_VECTOR_LEN;
|
|
747
|
+
const ret = wasm.webengine_remoteCatalog(this.__wbg_ptr, ptr0, len0);
|
|
748
|
+
if (ret[2]) {
|
|
749
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
750
|
+
}
|
|
751
|
+
return RemoteCatalog.__wrap(ret[0]);
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Removes `build` of `model` (every build of it when left out), except files another build uses; rejects with
|
|
755
|
+
* `build-not-found`, or `model-in-use` while one of those builds is loaded; it waits for installs and loads in
|
|
756
|
+
* progress.
|
|
757
|
+
* @param {string} model
|
|
758
|
+
* @param {string | null} [build]
|
|
759
|
+
* @returns {Promise<void>}
|
|
760
|
+
*/
|
|
761
|
+
uninstall(model, build) {
|
|
762
|
+
const ptr0 = passStringToWasm0(model, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
763
|
+
const len0 = WASM_VECTOR_LEN;
|
|
764
|
+
var ptr1 = isLikeNone(build) ? 0 : passStringToWasm0(build, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
765
|
+
var len1 = WASM_VECTOR_LEN;
|
|
766
|
+
const ret = wasm.webengine_uninstall(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
767
|
+
return ret;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if (Symbol.dispose) WebEngine.prototype[Symbol.dispose] = WebEngine.prototype.free;
|
|
771
|
+
function __wbg_get_imports() {
|
|
772
|
+
const import0 = {
|
|
773
|
+
__proto__: null,
|
|
774
|
+
__wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
|
|
775
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
776
|
+
return ret;
|
|
777
|
+
},
|
|
778
|
+
__wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
|
|
779
|
+
const ret = debugString(arg1);
|
|
780
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
781
|
+
const len1 = WASM_VECTOR_LEN;
|
|
782
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
783
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
784
|
+
},
|
|
785
|
+
__wbg___wbindgen_is_falsy_16bd49b68658263e: function(arg0) {
|
|
786
|
+
const ret = !arg0;
|
|
787
|
+
return ret;
|
|
788
|
+
},
|
|
789
|
+
__wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
|
|
790
|
+
const ret = typeof(arg0) === 'function';
|
|
791
|
+
return ret;
|
|
792
|
+
},
|
|
793
|
+
__wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
|
|
794
|
+
const ret = arg0 === null;
|
|
795
|
+
return ret;
|
|
796
|
+
},
|
|
797
|
+
__wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
|
|
798
|
+
const ret = arg0 === undefined;
|
|
799
|
+
return ret;
|
|
800
|
+
},
|
|
801
|
+
__wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
|
|
802
|
+
const obj = arg1;
|
|
803
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
804
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
805
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
806
|
+
},
|
|
807
|
+
__wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
|
|
808
|
+
const obj = arg1;
|
|
809
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
810
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
811
|
+
var len1 = WASM_VECTOR_LEN;
|
|
812
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
813
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
814
|
+
},
|
|
815
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
816
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
817
|
+
},
|
|
818
|
+
__wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
|
|
819
|
+
arg0._wbg_cb_unref();
|
|
820
|
+
},
|
|
821
|
+
__wbg_abort_a5cdc6b1270f69c3: function() { return handleError(function (arg0) {
|
|
822
|
+
const ret = arg0.abort();
|
|
823
|
+
return ret;
|
|
824
|
+
}, arguments); },
|
|
825
|
+
__wbg_abort_f78b99d80248bacb: function(arg0) {
|
|
826
|
+
arg0.abort();
|
|
827
|
+
},
|
|
828
|
+
__wbg_aborted_5b2b5f06b5e59fde: function(arg0) {
|
|
829
|
+
const ret = arg0.aborted;
|
|
830
|
+
return ret;
|
|
831
|
+
},
|
|
832
|
+
__wbg_addEventListener_4d0db17c671ea324: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
833
|
+
arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
834
|
+
}, arguments); },
|
|
835
|
+
__wbg_apply_b3c0654aebfdfdcd: function() { return handleError(function (arg0, arg1, arg2) {
|
|
836
|
+
const ret = Reflect.apply(arg0, arg1, arg2);
|
|
837
|
+
return ret;
|
|
838
|
+
}, arguments); },
|
|
839
|
+
__wbg_arrayBuffer_0fe6e1300abcf908: function(arg0) {
|
|
840
|
+
const ret = arg0.arrayBuffer();
|
|
841
|
+
return ret;
|
|
842
|
+
},
|
|
843
|
+
__wbg_arrayBuffer_f07be74819944ea2: function() { return handleError(function (arg0) {
|
|
844
|
+
const ret = arg0.arrayBuffer();
|
|
845
|
+
return ret;
|
|
846
|
+
}, arguments); },
|
|
847
|
+
__wbg_at_31a66e62eefd72ad: function(arg0, arg1) {
|
|
848
|
+
const ret = arg0.at(arg1);
|
|
849
|
+
return ret;
|
|
850
|
+
},
|
|
851
|
+
__wbg_body_4e088733babc630d: function(arg0) {
|
|
852
|
+
const ret = arg0.body;
|
|
853
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
854
|
+
},
|
|
855
|
+
__wbg_call_1875a20c43a36133: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
856
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
857
|
+
return ret;
|
|
858
|
+
}, arguments); },
|
|
859
|
+
__wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
|
|
860
|
+
const ret = arg0.call(arg1, arg2);
|
|
861
|
+
return ret;
|
|
862
|
+
}, arguments); },
|
|
863
|
+
__wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
|
|
864
|
+
const ret = arg0.call(arg1);
|
|
865
|
+
return ret;
|
|
866
|
+
}, arguments); },
|
|
867
|
+
__wbg_cancel_7c2a08c8db4c73f3: function(arg0) {
|
|
868
|
+
const ret = arg0.cancel();
|
|
869
|
+
return ret;
|
|
870
|
+
},
|
|
871
|
+
__wbg_capabilities_b5e5bcc733db48b8: function() { return handleError(function (arg0) {
|
|
872
|
+
const ret = arg0.capabilities();
|
|
873
|
+
return ret;
|
|
874
|
+
}, arguments); },
|
|
875
|
+
__wbg_close_8ab7ac8467136953: function() { return handleError(function (arg0) {
|
|
876
|
+
const ret = arg0.close();
|
|
877
|
+
return ret;
|
|
878
|
+
}, arguments); },
|
|
879
|
+
__wbg_construct_2cc135b78387ed16: function() { return handleError(function (arg0, arg1) {
|
|
880
|
+
const ret = Reflect.construct(arg0, arg1);
|
|
881
|
+
return ret;
|
|
882
|
+
}, arguments); },
|
|
883
|
+
__wbg_createWritable_3d194713b844bc79: function() { return handleError(function (arg0) {
|
|
884
|
+
const ret = arg0.createWritable();
|
|
885
|
+
return ret;
|
|
886
|
+
}, arguments); },
|
|
887
|
+
__wbg_detectLanguage_c88793e5c87907fa: function() { return handleError(function (arg0, arg1, arg2) {
|
|
888
|
+
const ret = detectLanguage(arg0, arg1, arg2);
|
|
889
|
+
return ret;
|
|
890
|
+
}, arguments); },
|
|
891
|
+
__wbg_from_296ca31f8d0f1c52: function(arg0) {
|
|
892
|
+
const ret = Array.from(arg0);
|
|
893
|
+
return ret;
|
|
894
|
+
},
|
|
895
|
+
__wbg_getDirectoryHandle_cc672697ce111750: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
896
|
+
const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
897
|
+
return ret;
|
|
898
|
+
}, arguments); },
|
|
899
|
+
__wbg_getFileHandle_3a422892559f72a8: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
900
|
+
const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
901
|
+
return ret;
|
|
902
|
+
}, arguments); },
|
|
903
|
+
__wbg_getFile_6b82a941e9dae613: function() { return handleError(function (arg0) {
|
|
904
|
+
const ret = arg0.getFile();
|
|
905
|
+
return ret;
|
|
906
|
+
}, arguments); },
|
|
907
|
+
__wbg_getReader_e782bd33388a2c7b: function(arg0) {
|
|
908
|
+
const ret = arg0.getReader();
|
|
909
|
+
return ret;
|
|
910
|
+
},
|
|
911
|
+
__wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
|
|
912
|
+
const ret = Reflect.get(arg0, arg1);
|
|
913
|
+
return ret;
|
|
914
|
+
}, arguments); },
|
|
915
|
+
__wbg_get_6c896e0571ddae51: function(arg0, arg1) {
|
|
916
|
+
const ret = arg0[arg1 >>> 0];
|
|
917
|
+
return ret;
|
|
918
|
+
},
|
|
919
|
+
__wbg_get_f75619e20cb68514: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
920
|
+
const ret = arg1.get(getStringFromWasm0(arg2, arg3));
|
|
921
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
922
|
+
var len1 = WASM_VECTOR_LEN;
|
|
923
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
924
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
925
|
+
}, arguments); },
|
|
926
|
+
__wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
|
|
927
|
+
const ret = arg0[arg1 >>> 0];
|
|
928
|
+
return ret;
|
|
929
|
+
},
|
|
930
|
+
__wbg_headers_eba93595f8944c2f: function(arg0) {
|
|
931
|
+
const ret = arg0.headers;
|
|
932
|
+
return ret;
|
|
933
|
+
},
|
|
934
|
+
__wbg_importEspeak_7cb11e9098aaa69f: function() { return handleError(function () {
|
|
935
|
+
const ret = importEspeak();
|
|
936
|
+
return ret;
|
|
937
|
+
}, arguments); },
|
|
938
|
+
__wbg_importTransformers_4771fbafdde6b11d: function() { return handleError(function () {
|
|
939
|
+
const ret = importTransformers();
|
|
940
|
+
return ret;
|
|
941
|
+
}, arguments); },
|
|
942
|
+
__wbg_instanceof_Float32Array_595afb0f28b828c9: function(arg0) {
|
|
943
|
+
let result;
|
|
944
|
+
try {
|
|
945
|
+
result = arg0 instanceof Float32Array;
|
|
946
|
+
} catch (_) {
|
|
947
|
+
result = false;
|
|
948
|
+
}
|
|
949
|
+
const ret = result;
|
|
950
|
+
return ret;
|
|
951
|
+
},
|
|
952
|
+
__wbg_instanceof_Promise_e1dc6893aa1ece28: function(arg0) {
|
|
953
|
+
let result;
|
|
954
|
+
try {
|
|
955
|
+
result = arg0 instanceof Promise;
|
|
956
|
+
} catch (_) {
|
|
957
|
+
result = false;
|
|
958
|
+
}
|
|
959
|
+
const ret = result;
|
|
960
|
+
return ret;
|
|
961
|
+
},
|
|
962
|
+
__wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
|
|
963
|
+
let result;
|
|
964
|
+
try {
|
|
965
|
+
result = arg0 instanceof Uint8Array;
|
|
966
|
+
} catch (_) {
|
|
967
|
+
result = false;
|
|
968
|
+
}
|
|
969
|
+
const ret = result;
|
|
970
|
+
return ret;
|
|
971
|
+
},
|
|
972
|
+
__wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
|
|
973
|
+
const ret = Array.isArray(arg0);
|
|
974
|
+
return ret;
|
|
975
|
+
},
|
|
976
|
+
__wbg_is_4b278c0bd3caba97: function(arg0, arg1) {
|
|
977
|
+
const ret = Object.is(arg0, arg1);
|
|
978
|
+
return ret;
|
|
979
|
+
},
|
|
980
|
+
__wbg_length_58572db4c38f3c3e: function(arg0) {
|
|
981
|
+
const ret = arg0.length;
|
|
982
|
+
return ret;
|
|
983
|
+
},
|
|
984
|
+
__wbg_length_7f3c00c40364105e: function(arg0) {
|
|
985
|
+
const ret = arg0.length;
|
|
986
|
+
return ret;
|
|
987
|
+
},
|
|
988
|
+
__wbg_length_d4bdea10311bd9cf: function(arg0) {
|
|
989
|
+
const ret = arg0.length;
|
|
990
|
+
return ret;
|
|
991
|
+
},
|
|
992
|
+
__wbg_localcatalog_new: function(arg0) {
|
|
993
|
+
const ret = LocalCatalog.__wrap(arg0);
|
|
994
|
+
return ret;
|
|
995
|
+
},
|
|
996
|
+
__wbg_localmodel_new: function(arg0) {
|
|
997
|
+
const ret = LocalModel.__wrap(arg0);
|
|
998
|
+
return ret;
|
|
999
|
+
},
|
|
1000
|
+
__wbg_move_a1b9d32f9dbee886: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1001
|
+
const ret = arg0.move(arg1, getStringFromWasm0(arg2, arg3));
|
|
1002
|
+
return ret;
|
|
1003
|
+
}, arguments); },
|
|
1004
|
+
__wbg_new_1dbf7428bba60a42: function(arg0) {
|
|
1005
|
+
const ret = new Uint8Array(arg0);
|
|
1006
|
+
return ret;
|
|
1007
|
+
},
|
|
1008
|
+
__wbg_new_2e41357094e99294: function() { return handleError(function () {
|
|
1009
|
+
const ret = new AbortController();
|
|
1010
|
+
return ret;
|
|
1011
|
+
}, arguments); },
|
|
1012
|
+
__wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
|
|
1013
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1014
|
+
return ret;
|
|
1015
|
+
},
|
|
1016
|
+
__wbg_new_5502aad30c185fc8: function(arg0, arg1) {
|
|
1017
|
+
try {
|
|
1018
|
+
var state0 = {a: arg0, b: arg1};
|
|
1019
|
+
var cb0 = (arg0, arg1) => {
|
|
1020
|
+
const a = state0.a;
|
|
1021
|
+
state0.a = 0;
|
|
1022
|
+
try {
|
|
1023
|
+
return wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1024
|
+
} finally {
|
|
1025
|
+
state0.a = a;
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
const ret = new Promise(cb0);
|
|
1029
|
+
return ret;
|
|
1030
|
+
} finally {
|
|
1031
|
+
state0.a = 0;
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
__wbg_new_617a8cdb8bb1130e: function() {
|
|
1035
|
+
const ret = new Object();
|
|
1036
|
+
return ret;
|
|
1037
|
+
},
|
|
1038
|
+
__wbg_new_63c4c65d2534e5d3: function(arg0) {
|
|
1039
|
+
const ret = new Float32Array(arg0);
|
|
1040
|
+
return ret;
|
|
1041
|
+
},
|
|
1042
|
+
__wbg_new_ee2291f50781bf1d: function() {
|
|
1043
|
+
const ret = new Array();
|
|
1044
|
+
return ret;
|
|
1045
|
+
},
|
|
1046
|
+
__wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
|
|
1047
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1048
|
+
return ret;
|
|
1049
|
+
},
|
|
1050
|
+
__wbg_new_from_slice_ca6ad97db1f4779a: function(arg0, arg1) {
|
|
1051
|
+
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
1052
|
+
return ret;
|
|
1053
|
+
},
|
|
1054
|
+
__wbg_new_no_args_549db978c37d28cc: function(arg0, arg1) {
|
|
1055
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1056
|
+
return ret;
|
|
1057
|
+
},
|
|
1058
|
+
__wbg_new_typed_b01cb72a8af741a3: function(arg0, arg1) {
|
|
1059
|
+
try {
|
|
1060
|
+
var state0 = {a: arg0, b: arg1};
|
|
1061
|
+
var cb0 = (arg0, arg1) => {
|
|
1062
|
+
const a = state0.a;
|
|
1063
|
+
state0.a = 0;
|
|
1064
|
+
try {
|
|
1065
|
+
return wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1066
|
+
} finally {
|
|
1067
|
+
state0.a = a;
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
const ret = new Promise(cb0);
|
|
1071
|
+
return ret;
|
|
1072
|
+
} finally {
|
|
1073
|
+
state0.a = 0;
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
1077
|
+
const ret = arg0.now();
|
|
1078
|
+
return ret;
|
|
1079
|
+
},
|
|
1080
|
+
__wbg_of_dde0b9d3265685ee: function(arg0, arg1, arg2) {
|
|
1081
|
+
const ret = Array.of(arg0, arg1, arg2);
|
|
1082
|
+
return ret;
|
|
1083
|
+
},
|
|
1084
|
+
__wbg_ok_125878a7db256ecb: function(arg0) {
|
|
1085
|
+
const ret = arg0.ok;
|
|
1086
|
+
return ret;
|
|
1087
|
+
},
|
|
1088
|
+
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
1089
|
+
const ret = arg0.performance;
|
|
1090
|
+
return ret;
|
|
1091
|
+
},
|
|
1092
|
+
__wbg_prototypesetcall_8b03c01e2c0f8066: function(arg0, arg1, arg2) {
|
|
1093
|
+
Float32Array.prototype.set.call(getArrayF32FromWasm0(arg0, arg1), arg2);
|
|
1094
|
+
},
|
|
1095
|
+
__wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
|
|
1096
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1097
|
+
},
|
|
1098
|
+
__wbg_push_2baf45db356cf468: function(arg0, arg1) {
|
|
1099
|
+
const ret = arg0.push(arg1);
|
|
1100
|
+
return ret;
|
|
1101
|
+
},
|
|
1102
|
+
__wbg_queueMicrotask_9833f9a49df95a49: function(arg0) {
|
|
1103
|
+
const ret = arg0.queueMicrotask;
|
|
1104
|
+
return ret;
|
|
1105
|
+
},
|
|
1106
|
+
__wbg_queueMicrotask_a72f977e97f23c5f: function(arg0) {
|
|
1107
|
+
queueMicrotask(arg0);
|
|
1108
|
+
},
|
|
1109
|
+
__wbg_random_5a4cafd2f02395ff: function() {
|
|
1110
|
+
const ret = Math.random();
|
|
1111
|
+
return ret;
|
|
1112
|
+
},
|
|
1113
|
+
__wbg_read_2a943774344c9728: function(arg0) {
|
|
1114
|
+
const ret = arg0.read();
|
|
1115
|
+
return ret;
|
|
1116
|
+
},
|
|
1117
|
+
__wbg_remotecatalog_new: function(arg0) {
|
|
1118
|
+
const ret = RemoteCatalog.__wrap(arg0);
|
|
1119
|
+
return ret;
|
|
1120
|
+
},
|
|
1121
|
+
__wbg_remotemodel_new: function(arg0) {
|
|
1122
|
+
const ret = RemoteModel.__wrap(arg0);
|
|
1123
|
+
return ret;
|
|
1124
|
+
},
|
|
1125
|
+
__wbg_removeEntry_e800316632dd1389: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1126
|
+
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
|
|
1127
|
+
return ret;
|
|
1128
|
+
}, arguments); },
|
|
1129
|
+
__wbg_removeEventListener_6e68185345978771: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1130
|
+
arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
1131
|
+
}, arguments); },
|
|
1132
|
+
__wbg_resolve_0076e10020304ede: function(arg0) {
|
|
1133
|
+
const ret = Promise.resolve(arg0);
|
|
1134
|
+
return ret;
|
|
1135
|
+
},
|
|
1136
|
+
__wbg_serve_42dd3893fad4deab: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1137
|
+
const ret = serve(arg0, getStringFromWasm0(arg1, arg2), arg3);
|
|
1138
|
+
return ret;
|
|
1139
|
+
}, arguments); },
|
|
1140
|
+
__wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1141
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1142
|
+
return ret;
|
|
1143
|
+
}, arguments); },
|
|
1144
|
+
__wbg_signal_e5a49a2d9c65b7f6: function(arg0) {
|
|
1145
|
+
const ret = arg0.signal;
|
|
1146
|
+
return ret;
|
|
1147
|
+
},
|
|
1148
|
+
__wbg_sileroRun_6e3299c95fe3ca5c: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1149
|
+
const ret = sileroRun(arg0, arg1, arg2, arg3, arg4 >>> 0);
|
|
1150
|
+
return ret;
|
|
1151
|
+
}, arguments); },
|
|
1152
|
+
__wbg_size_8f1c0b1a1fbb3810: function(arg0) {
|
|
1153
|
+
const ret = arg0.size;
|
|
1154
|
+
return ret;
|
|
1155
|
+
},
|
|
1156
|
+
__wbg_smartTurnRun_8100ba2230364530: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1157
|
+
const ret = smartTurnRun(arg0, arg1, getStringFromWasm0(arg2, arg3), arg4, arg5 >>> 0, arg6 >>> 0);
|
|
1158
|
+
return ret;
|
|
1159
|
+
}, arguments); },
|
|
1160
|
+
__wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
|
|
1161
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1162
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1163
|
+
},
|
|
1164
|
+
__wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
|
|
1165
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1166
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1167
|
+
},
|
|
1168
|
+
__wbg_static_accessor_SELF_0b583911f537483a: function() {
|
|
1169
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1170
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1171
|
+
},
|
|
1172
|
+
__wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
|
|
1173
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1174
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1175
|
+
},
|
|
1176
|
+
__wbg_status_ce0a98d3c57125f3: function(arg0) {
|
|
1177
|
+
const ret = arg0.status;
|
|
1178
|
+
return ret;
|
|
1179
|
+
},
|
|
1180
|
+
__wbg_stream_4bed61a7503885e5: function(arg0) {
|
|
1181
|
+
const ret = arg0.stream();
|
|
1182
|
+
return ret;
|
|
1183
|
+
},
|
|
1184
|
+
__wbg_text_d553e499e052fa78: function(arg0) {
|
|
1185
|
+
const ret = arg0.text();
|
|
1186
|
+
return ret;
|
|
1187
|
+
},
|
|
1188
|
+
__wbg_then_c949d5a25a4e78f8: function(arg0, arg1, arg2) {
|
|
1189
|
+
const ret = arg0.then(arg1, arg2);
|
|
1190
|
+
return ret;
|
|
1191
|
+
},
|
|
1192
|
+
__wbg_then_e71170d78fcf8954: function(arg0, arg1) {
|
|
1193
|
+
const ret = arg0.then(arg1);
|
|
1194
|
+
return ret;
|
|
1195
|
+
},
|
|
1196
|
+
__wbg_vadstream_new: function(arg0) {
|
|
1197
|
+
const ret = VadStream.__wrap(arg0);
|
|
1198
|
+
return ret;
|
|
1199
|
+
},
|
|
1200
|
+
__wbg_warn_13abc63e0d4b3527: function(arg0) {
|
|
1201
|
+
console.warn(arg0);
|
|
1202
|
+
},
|
|
1203
|
+
__wbg_warn_88929063e36ba285: function(arg0, arg1, arg2, arg3) {
|
|
1204
|
+
console.warn(arg0, arg1, arg2, arg3);
|
|
1205
|
+
},
|
|
1206
|
+
__wbg_warn_b083f6aa089f2e7c: function(arg0, arg1) {
|
|
1207
|
+
console.warn(arg0, arg1);
|
|
1208
|
+
},
|
|
1209
|
+
__wbg_warn_d82845205ec38be7: function(arg0, arg1, arg2) {
|
|
1210
|
+
console.warn(arg0, arg1, arg2);
|
|
1211
|
+
},
|
|
1212
|
+
__wbg_webengine_new: function(arg0) {
|
|
1213
|
+
const ret = WebEngine.__wrap(arg0);
|
|
1214
|
+
return ret;
|
|
1215
|
+
},
|
|
1216
|
+
__wbg_write_a0f6ab8ae32cfdaf: function() { return handleError(function (arg0, arg1) {
|
|
1217
|
+
const ret = arg0.write(arg1);
|
|
1218
|
+
return ret;
|
|
1219
|
+
}, arguments); },
|
|
1220
|
+
__wbg_write_edd5321b89ebd6e9: function() { return handleError(function (arg0, arg1) {
|
|
1221
|
+
const ret = arg0.write(arg1);
|
|
1222
|
+
return ret;
|
|
1223
|
+
}, arguments); },
|
|
1224
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
1225
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 752, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1226
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___wasm_bindgen_63a46d96b29ae508___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_63a46d96b29ae508___JsError___true_);
|
|
1227
|
+
return ret;
|
|
1228
|
+
},
|
|
1229
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
1230
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 181, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
|
|
1231
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___alloc_508e33bd5656020b___string__String__js_sys_9a9f93f03cc98e8d___Promise__true_);
|
|
1232
|
+
return ret;
|
|
1233
|
+
},
|
|
1234
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
1235
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 183, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1236
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke_______true_);
|
|
1237
|
+
return ret;
|
|
1238
|
+
},
|
|
1239
|
+
__wbindgen_generic_0000000000000004: function(arg0) {
|
|
1240
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1241
|
+
const ret = arg0;
|
|
1242
|
+
return ret;
|
|
1243
|
+
},
|
|
1244
|
+
__wbindgen_generic_0000000000000005: function(arg0, arg1) {
|
|
1245
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1246
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1247
|
+
return ret;
|
|
1248
|
+
},
|
|
1249
|
+
__wbindgen_init_externref_table: function() {
|
|
1250
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1251
|
+
const offset = table.grow(4);
|
|
1252
|
+
table.set(0, undefined);
|
|
1253
|
+
table.set(offset + 0, undefined);
|
|
1254
|
+
table.set(offset + 1, null);
|
|
1255
|
+
table.set(offset + 2, true);
|
|
1256
|
+
table.set(offset + 3, false);
|
|
1257
|
+
},
|
|
1258
|
+
};
|
|
1259
|
+
return {
|
|
1260
|
+
__proto__: null,
|
|
1261
|
+
"./sidevoice_engine_bg.js": import0,
|
|
1262
|
+
"./snippets/sidevoice-engine-1f1d4d6bbcff4dc5/inline4.js": import1,
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke_______true_(arg0, arg1) {
|
|
1267
|
+
wasm.wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke_______true_(arg0, arg1);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
function wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___wasm_bindgen_63a46d96b29ae508___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_63a46d96b29ae508___JsError___true_(arg0, arg1, arg2) {
|
|
1271
|
+
const ret = wasm.wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___wasm_bindgen_63a46d96b29ae508___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_63a46d96b29ae508___JsError___true_(arg0, arg1, arg2);
|
|
1272
|
+
if (ret[1]) {
|
|
1273
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
function wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
1278
|
+
wasm.wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined___js_sys_9a9f93f03cc98e8d___Function_fn_wasm_bindgen_63a46d96b29ae508___JsValue_____wasm_bindgen_63a46d96b29ae508___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
function wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___alloc_508e33bd5656020b___string__String__js_sys_9a9f93f03cc98e8d___Promise__true_(arg0, arg1, arg2) {
|
|
1282
|
+
const ptr0 = passStringToWasm0(arg2, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
1283
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1284
|
+
const ret = wasm.wasm_bindgen_63a46d96b29ae508___convert__closures_____invoke___alloc_508e33bd5656020b___string__String__js_sys_9a9f93f03cc98e8d___Promise__true_(arg0, arg1, ptr0, len0);
|
|
1285
|
+
return ret;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
const EndOfTurnFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1289
|
+
? { register: () => {}, unregister: () => {} }
|
|
1290
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_endofturn_free(ptr, 1));
|
|
1291
|
+
const LocalCatalogFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1292
|
+
? { register: () => {}, unregister: () => {} }
|
|
1293
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_localcatalog_free(ptr, 1));
|
|
1294
|
+
const LocalModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1295
|
+
? { register: () => {}, unregister: () => {} }
|
|
1296
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_localmodel_free(ptr, 1));
|
|
1297
|
+
const RemoteCatalogFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1298
|
+
? { register: () => {}, unregister: () => {} }
|
|
1299
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_remotecatalog_free(ptr, 1));
|
|
1300
|
+
const RemoteModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1301
|
+
? { register: () => {}, unregister: () => {} }
|
|
1302
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_remotemodel_free(ptr, 1));
|
|
1303
|
+
const SttFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1304
|
+
? { register: () => {}, unregister: () => {} }
|
|
1305
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_stt_free(ptr, 1));
|
|
1306
|
+
const TtsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1307
|
+
? { register: () => {}, unregister: () => {} }
|
|
1308
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tts_free(ptr, 1));
|
|
1309
|
+
const VadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1310
|
+
? { register: () => {}, unregister: () => {} }
|
|
1311
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_vad_free(ptr, 1));
|
|
1312
|
+
const VadStreamFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1313
|
+
? { register: () => {}, unregister: () => {} }
|
|
1314
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_vadstream_free(ptr, 1));
|
|
1315
|
+
const WebEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1316
|
+
? { register: () => {}, unregister: () => {} }
|
|
1317
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_webengine_free(ptr, 1));
|
|
1318
|
+
|
|
1319
|
+
function addToExternrefTable0(obj) {
|
|
1320
|
+
const idx = wasm.__externref_table_alloc_command_export();
|
|
1321
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1322
|
+
return idx;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1326
|
+
? { register: () => {}, unregister: () => {} }
|
|
1327
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure_command_export(state.a, state.b));
|
|
1328
|
+
|
|
1329
|
+
function debugString(val) {
|
|
1330
|
+
// primitive types
|
|
1331
|
+
const type = typeof val;
|
|
1332
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1333
|
+
return `${val}`;
|
|
1334
|
+
}
|
|
1335
|
+
if (type == 'string') {
|
|
1336
|
+
return `"${val}"`;
|
|
1337
|
+
}
|
|
1338
|
+
if (type == 'symbol') {
|
|
1339
|
+
const description = val.description;
|
|
1340
|
+
if (description == null) {
|
|
1341
|
+
return 'Symbol';
|
|
1342
|
+
} else {
|
|
1343
|
+
return `Symbol(${description})`;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
if (type == 'function') {
|
|
1347
|
+
const name = val.name;
|
|
1348
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1349
|
+
return `Function(${name})`;
|
|
1350
|
+
} else {
|
|
1351
|
+
return 'Function';
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
// objects
|
|
1355
|
+
if (Array.isArray(val)) {
|
|
1356
|
+
const length = val.length;
|
|
1357
|
+
let debug = '[';
|
|
1358
|
+
if (length > 0) {
|
|
1359
|
+
debug += debugString(val[0]);
|
|
1360
|
+
}
|
|
1361
|
+
for(let i = 1; i < length; i++) {
|
|
1362
|
+
debug += ', ' + debugString(val[i]);
|
|
1363
|
+
}
|
|
1364
|
+
debug += ']';
|
|
1365
|
+
return debug;
|
|
1366
|
+
}
|
|
1367
|
+
// Test for built-in
|
|
1368
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1369
|
+
let className;
|
|
1370
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1371
|
+
className = builtInMatches[1];
|
|
1372
|
+
} else {
|
|
1373
|
+
// Failed to match the standard '[object ClassName]'
|
|
1374
|
+
return toString.call(val);
|
|
1375
|
+
}
|
|
1376
|
+
if (className == 'Object') {
|
|
1377
|
+
// we're a user defined class or Object
|
|
1378
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1379
|
+
// easier than looping through ownProperties of `val`.
|
|
1380
|
+
try {
|
|
1381
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1382
|
+
} catch (_) {
|
|
1383
|
+
return 'Object';
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
// errors
|
|
1387
|
+
if (val instanceof Error) {
|
|
1388
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1389
|
+
}
|
|
1390
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1391
|
+
return className;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
1395
|
+
ptr = ptr >>> 0;
|
|
1396
|
+
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1400
|
+
ptr = ptr >>> 0;
|
|
1401
|
+
const mem = getDataViewMemory0();
|
|
1402
|
+
const result = [];
|
|
1403
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1404
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
1405
|
+
}
|
|
1406
|
+
wasm.__externref_drop_slice_command_export(ptr, len);
|
|
1407
|
+
return result;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1411
|
+
ptr = ptr >>> 0;
|
|
1412
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
let cachedDataViewMemory0 = null;
|
|
1416
|
+
function getDataViewMemory0() {
|
|
1417
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1418
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1419
|
+
}
|
|
1420
|
+
return cachedDataViewMemory0;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
1424
|
+
function getFloat32ArrayMemory0() {
|
|
1425
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
1426
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
1427
|
+
}
|
|
1428
|
+
return cachedFloat32ArrayMemory0;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
function getStringFromWasm0(ptr, len) {
|
|
1432
|
+
return decodeText(ptr >>> 0, len);
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1436
|
+
function getUint8ArrayMemory0() {
|
|
1437
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1438
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1439
|
+
}
|
|
1440
|
+
return cachedUint8ArrayMemory0;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
function handleError(f, args) {
|
|
1444
|
+
try {
|
|
1445
|
+
return f.apply(this, args);
|
|
1446
|
+
} catch (e) {
|
|
1447
|
+
const idx = addToExternrefTable0(e);
|
|
1448
|
+
wasm.__wbindgen_exn_store_command_export(idx);
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
function isLikeNone(x) {
|
|
1453
|
+
return x === undefined || x === null;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
1457
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
1458
|
+
const real = (...args) => {
|
|
1459
|
+
|
|
1460
|
+
// First up with a closure we increment the internal reference
|
|
1461
|
+
// count. This ensures that the Rust closure environment won't
|
|
1462
|
+
// be deallocated while we're invoking it.
|
|
1463
|
+
state.cnt++;
|
|
1464
|
+
const a = state.a;
|
|
1465
|
+
state.a = 0;
|
|
1466
|
+
try {
|
|
1467
|
+
return f(a, state.b, ...args);
|
|
1468
|
+
} finally {
|
|
1469
|
+
state.a = a;
|
|
1470
|
+
real._wbg_cb_unref();
|
|
1471
|
+
}
|
|
1472
|
+
};
|
|
1473
|
+
real._wbg_cb_unref = () => {
|
|
1474
|
+
if (--state.cnt === 0) {
|
|
1475
|
+
wasm.__wbindgen_destroy_closure_command_export(state.a, state.b);
|
|
1476
|
+
state.a = 0;
|
|
1477
|
+
CLOSURE_DTORS.unregister(state);
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1481
|
+
return real;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
1485
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
1486
|
+
getFloat32ArrayMemory0().set(arg, ptr / 4);
|
|
1487
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1488
|
+
return ptr;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1492
|
+
if (realloc === undefined) {
|
|
1493
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1494
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1495
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1496
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1497
|
+
return ptr;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
let len = arg.length;
|
|
1501
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1502
|
+
|
|
1503
|
+
const mem = getUint8ArrayMemory0();
|
|
1504
|
+
|
|
1505
|
+
let offset = 0;
|
|
1506
|
+
|
|
1507
|
+
for (; offset < len; offset++) {
|
|
1508
|
+
const code = arg.charCodeAt(offset);
|
|
1509
|
+
if (code > 0x7F) break;
|
|
1510
|
+
mem[ptr + offset] = code;
|
|
1511
|
+
}
|
|
1512
|
+
if (offset !== len) {
|
|
1513
|
+
if (offset !== 0) {
|
|
1514
|
+
arg = arg.slice(offset);
|
|
1515
|
+
}
|
|
1516
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1517
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1518
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1519
|
+
|
|
1520
|
+
offset += ret.written;
|
|
1521
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
WASM_VECTOR_LEN = offset;
|
|
1525
|
+
return ptr;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
function takeFromExternrefTable0(idx) {
|
|
1529
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1530
|
+
wasm.__externref_table_dealloc_command_export(idx);
|
|
1531
|
+
return value;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1535
|
+
cachedTextDecoder.decode();
|
|
1536
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1537
|
+
let numBytesDecoded = 0;
|
|
1538
|
+
function decodeText(ptr, len) {
|
|
1539
|
+
numBytesDecoded += len;
|
|
1540
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1541
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1542
|
+
cachedTextDecoder.decode();
|
|
1543
|
+
numBytesDecoded = len;
|
|
1544
|
+
}
|
|
1545
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1549
|
+
|
|
1550
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1551
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1552
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1553
|
+
view.set(buf);
|
|
1554
|
+
return {
|
|
1555
|
+
read: arg.length,
|
|
1556
|
+
written: buf.length
|
|
1557
|
+
};
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
let WASM_VECTOR_LEN = 0;
|
|
1562
|
+
|
|
1563
|
+
let wasmModule, wasmInstance, wasm;
|
|
1564
|
+
function __wbg_finalize_init(instance, module) {
|
|
1565
|
+
wasmInstance = instance;
|
|
1566
|
+
wasm = instance.exports;
|
|
1567
|
+
wasmModule = module;
|
|
1568
|
+
cachedDataViewMemory0 = null;
|
|
1569
|
+
cachedFloat32ArrayMemory0 = null;
|
|
1570
|
+
cachedUint8ArrayMemory0 = null;
|
|
1571
|
+
wasm.__wbindgen_start();
|
|
1572
|
+
return wasm;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
async function __wbg_load(module, imports) {
|
|
1576
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1577
|
+
if (!module.ok) {
|
|
1578
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1582
|
+
try {
|
|
1583
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1584
|
+
} catch (e) {
|
|
1585
|
+
const validResponse = expectedResponseType(module.type);
|
|
1586
|
+
|
|
1587
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1588
|
+
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);
|
|
1589
|
+
|
|
1590
|
+
} else { throw e; }
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
const bytes = await module.arrayBuffer();
|
|
1595
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1596
|
+
} else {
|
|
1597
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1598
|
+
|
|
1599
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1600
|
+
return { instance, module };
|
|
1601
|
+
} else {
|
|
1602
|
+
return instance;
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
function expectedResponseType(type) {
|
|
1607
|
+
switch (type) {
|
|
1608
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1609
|
+
}
|
|
1610
|
+
return false;
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
function initSync(module) {
|
|
1615
|
+
if (wasm !== undefined) return wasm;
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
if (module !== undefined) {
|
|
1619
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1620
|
+
({module} = module)
|
|
1621
|
+
} else {
|
|
1622
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
const imports = __wbg_get_imports();
|
|
1627
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1628
|
+
module = new WebAssembly.Module(module);
|
|
1629
|
+
}
|
|
1630
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1631
|
+
return __wbg_finalize_init(instance, module);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
async function __wbg_init(module_or_path) {
|
|
1635
|
+
if (wasm !== undefined) return wasm;
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
if (module_or_path !== undefined) {
|
|
1639
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1640
|
+
({module_or_path} = module_or_path)
|
|
1641
|
+
} else {
|
|
1642
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
if (module_or_path === undefined) {
|
|
1647
|
+
module_or_path = new URL('sidevoice_engine_bg.wasm', import.meta.url);
|
|
1648
|
+
}
|
|
1649
|
+
const imports = __wbg_get_imports();
|
|
1650
|
+
|
|
1651
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1652
|
+
module_or_path = fetch(module_or_path);
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1656
|
+
|
|
1657
|
+
return __wbg_finalize_init(instance, module);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
export { initSync, __wbg_init as default };
|