@ikonai/sdk 0.0.42 → 0.0.43
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/assets/audio-capture-worker-kpORDYGU.js +1138 -0
- package/assets/{audio-playback-worker-CYoIqiGJ.js → audio-playback-worker-Cwm3GaAx.js} +321 -212
- package/assets/{protocol-worker-E7o-6_bZ.js → protocol-worker-DKSTqFKg.js} +228 -207
- package/assets/video-capture-worker-BBs_62Fq.js +963 -0
- package/assets/video-playback-worker-Bfm3r5xW.js +924 -0
- package/client/ikon-client-config.d.ts +6 -10
- package/client/ikon-client.d.ts +4 -5
- package/index.js +1532 -1311
- package/media/audio-constants.d.ts +5 -0
- package/media/ikon-audio-playback.d.ts +53 -0
- package/media/ikon-video-capture.d.ts +0 -1
- package/media/ikon-video-playback.d.ts +0 -2
- package/media/video-constants.d.ts +42 -0
- package/package.json +1 -1
- package/worker/audio-playback-worker.d.ts +3 -0
- package/worker/video-capture-worker.d.ts +3 -1
- package/worker/video-playback-worker.d.ts +3 -0
- package/assets/audio-capture-worker-zx_Os6ad.js +0 -1112
- package/assets/video-capture-worker-CTRX9PKp.js +0 -843
- package/assets/video-playback-worker-CIuL9Crw.js +0 -875
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function ht(t) {
|
|
2
2
|
if (t.length < 8)
|
|
3
3
|
throw new Error("Protocol message too short");
|
|
4
4
|
return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
|
|
@@ -7,13 +7,13 @@ function q(t) {
|
|
|
7
7
|
const e = F(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
8
8
|
if (e.length < 27)
|
|
9
9
|
throw new Error("Protocol payload too short");
|
|
10
|
-
const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), o = r.getUint32(16, !0), _ = r.getUint32(20, !0),
|
|
10
|
+
const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), o = r.getUint32(16, !0), _ = r.getUint32(20, !0), u = r.getUint8(24), l = r.getUint8(25), E = r.getUint8(26);
|
|
11
11
|
if (27 + _ * 4 > e.length)
|
|
12
12
|
throw new Error("Protocol header exceeds payload length");
|
|
13
13
|
const N = [];
|
|
14
|
-
let
|
|
14
|
+
let w = 27;
|
|
15
15
|
for (let m = 0; m < _; m++)
|
|
16
|
-
N.push(r.getUint32(
|
|
16
|
+
N.push(r.getUint32(w, !0)), w += 4;
|
|
17
17
|
return {
|
|
18
18
|
length: s,
|
|
19
19
|
opcode: n,
|
|
@@ -21,7 +21,7 @@ function q(t) {
|
|
|
21
21
|
trackId: i,
|
|
22
22
|
sequenceId: o,
|
|
23
23
|
targetIds: N,
|
|
24
|
-
payloadVersion:
|
|
24
|
+
payloadVersion: u,
|
|
25
25
|
payloadType: l,
|
|
26
26
|
flags: E
|
|
27
27
|
};
|
|
@@ -38,9 +38,9 @@ function tt(t, e, r) {
|
|
|
38
38
|
return s.subarray(a, n.length);
|
|
39
39
|
}
|
|
40
40
|
var D = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(D || {});
|
|
41
|
-
const
|
|
41
|
+
const ft = 161, At = 162;
|
|
42
42
|
new TextEncoder();
|
|
43
|
-
const
|
|
43
|
+
const ct = new TextDecoder("utf-8", { fatal: !0 });
|
|
44
44
|
class M {
|
|
45
45
|
constructor(e, r, s) {
|
|
46
46
|
this.buffer = e, this.version = r, this.offset = s, this.end = e.length - 1;
|
|
@@ -51,7 +51,7 @@ class M {
|
|
|
51
51
|
const r = F(e);
|
|
52
52
|
if (r.length < 2)
|
|
53
53
|
throw new Error("Teleport payload too short");
|
|
54
|
-
if (r[0] !==
|
|
54
|
+
if (r[0] !== ft || r[r.length - 1] !== At)
|
|
55
55
|
throw new Error("Teleport object missing markers");
|
|
56
56
|
const s = { offset: 1 }, n = A(r, s, "InvalidLength");
|
|
57
57
|
return new M(r, n, s.offset);
|
|
@@ -61,23 +61,23 @@ class M {
|
|
|
61
61
|
return null;
|
|
62
62
|
if (this.offset + 5 > this.buffer.length)
|
|
63
63
|
throw new Error("Teleport object truncated");
|
|
64
|
-
const e =
|
|
64
|
+
const e = Ct(this.buffer, this.offset);
|
|
65
65
|
this.offset += 4;
|
|
66
66
|
const r = this.buffer[this.offset++], s = r >> 4 & 15;
|
|
67
67
|
if ((r & 15) !== 0)
|
|
68
68
|
throw new Error("Teleport field flags must be zero");
|
|
69
|
-
const n =
|
|
69
|
+
const n = d(s);
|
|
70
70
|
let a;
|
|
71
71
|
if (n >= 0)
|
|
72
|
-
|
|
72
|
+
f(this.buffer, this.offset, n), a = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
|
|
73
73
|
else {
|
|
74
74
|
const i = { offset: this.offset }, o = A(this.buffer, i, "InvalidLength");
|
|
75
|
-
|
|
75
|
+
f(this.buffer, i.offset, o), a = this.buffer.subarray(i.offset, i.offset + o), this.offset = i.offset + o;
|
|
76
76
|
}
|
|
77
|
-
return new
|
|
77
|
+
return new Tt(e, s, a);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
class
|
|
80
|
+
class S {
|
|
81
81
|
constructor(e, r) {
|
|
82
82
|
this.type = e, this.payload = r;
|
|
83
83
|
}
|
|
@@ -139,7 +139,7 @@ class C {
|
|
|
139
139
|
return this.ensureType(
|
|
140
140
|
12
|
|
141
141
|
/* String */
|
|
142
|
-
),
|
|
142
|
+
), ct.decode(this.payload);
|
|
143
143
|
}
|
|
144
144
|
asGuid() {
|
|
145
145
|
return this.ensureType(
|
|
@@ -157,7 +157,7 @@ class C {
|
|
|
157
157
|
return this.ensureType(
|
|
158
158
|
9
|
|
159
159
|
/* Array */
|
|
160
|
-
),
|
|
160
|
+
), x.create(this.payload);
|
|
161
161
|
}
|
|
162
162
|
asDictionary() {
|
|
163
163
|
return this.ensureType(
|
|
@@ -170,7 +170,7 @@ class C {
|
|
|
170
170
|
throw new Error(`Teleport value has type ${D[this.type]}, expected ${D[e]}`);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
class
|
|
173
|
+
class Tt extends S {
|
|
174
174
|
constructor(e, r, s) {
|
|
175
175
|
super(r, s), this.fieldId = e;
|
|
176
176
|
}
|
|
@@ -178,7 +178,7 @@ class At extends C {
|
|
|
178
178
|
return this.type === 1;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
class
|
|
181
|
+
class x {
|
|
182
182
|
payload;
|
|
183
183
|
elementType;
|
|
184
184
|
count;
|
|
@@ -194,7 +194,7 @@ class p {
|
|
|
194
194
|
this.count = A(e, s, "ArrayMalformed"), this.offset = s.offset;
|
|
195
195
|
}
|
|
196
196
|
static create(e) {
|
|
197
|
-
return new
|
|
197
|
+
return new x(F(e));
|
|
198
198
|
}
|
|
199
199
|
next() {
|
|
200
200
|
if (this.index >= this.count) {
|
|
@@ -215,38 +215,38 @@ class p {
|
|
|
215
215
|
case 4:
|
|
216
216
|
case 6:
|
|
217
217
|
case 14: {
|
|
218
|
-
const e =
|
|
219
|
-
|
|
218
|
+
const e = d(this.elementType);
|
|
219
|
+
f(this.payload, this.offset, e);
|
|
220
220
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
221
|
-
return this.offset += e, new
|
|
221
|
+
return this.offset += e, new O(this.elementType, r);
|
|
222
222
|
}
|
|
223
223
|
case 12:
|
|
224
224
|
case 13: {
|
|
225
225
|
const e = { offset: this.offset }, r = A(this.payload, e, "ArrayMalformed");
|
|
226
|
-
|
|
226
|
+
f(this.payload, e.offset, r);
|
|
227
227
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
228
|
-
return this.offset = e.offset + r, new
|
|
228
|
+
return this.offset = e.offset + r, new O(this.elementType, s);
|
|
229
229
|
}
|
|
230
230
|
case 11: {
|
|
231
231
|
const e = { offset: this.offset }, r = A(this.payload, e, "ArrayMalformed");
|
|
232
|
-
|
|
232
|
+
f(this.payload, e.offset, r);
|
|
233
233
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
234
|
-
return this.offset = e.offset + r, new
|
|
234
|
+
return this.offset = e.offset + r, new O(11, s);
|
|
235
235
|
}
|
|
236
236
|
case 9: {
|
|
237
237
|
const e = Y(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
238
|
-
return this.offset += e, new
|
|
238
|
+
return this.offset += e, new O(9, r);
|
|
239
239
|
}
|
|
240
240
|
case 10: {
|
|
241
241
|
const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
242
|
-
return this.offset += e, new
|
|
242
|
+
return this.offset += e, new O(10, r);
|
|
243
243
|
}
|
|
244
244
|
default:
|
|
245
245
|
throw new Error(`Unsupported array element type ${D[this.elementType]}`);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
class
|
|
249
|
+
class O extends S {
|
|
250
250
|
constructor(e, r) {
|
|
251
251
|
super(e, r);
|
|
252
252
|
}
|
|
@@ -277,20 +277,20 @@ class H {
|
|
|
277
277
|
return null;
|
|
278
278
|
}
|
|
279
279
|
const e = this.readKey(), r = this.readValue();
|
|
280
|
-
return this.index++, new
|
|
280
|
+
return this.index++, new Nt(e, r);
|
|
281
281
|
}
|
|
282
282
|
readKey() {
|
|
283
|
-
const e =
|
|
283
|
+
const e = d(this.keyType);
|
|
284
284
|
if (e >= 0) {
|
|
285
|
-
|
|
285
|
+
f(this.payload, this.offset, e);
|
|
286
286
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
287
|
-
return this.offset += e, new
|
|
287
|
+
return this.offset += e, new S(this.keyType, r);
|
|
288
288
|
}
|
|
289
289
|
if (this.keyType === 12 || this.keyType === 13) {
|
|
290
290
|
const r = { offset: this.offset }, s = A(this.payload, r, "DictMalformed");
|
|
291
|
-
|
|
291
|
+
f(this.payload, r.offset, s);
|
|
292
292
|
const n = this.payload.subarray(r.offset, r.offset + s);
|
|
293
|
-
return this.offset = r.offset + s, new
|
|
293
|
+
return this.offset = r.offset + s, new S(this.keyType, n);
|
|
294
294
|
}
|
|
295
295
|
throw new Error("Unsupported dictionary key type");
|
|
296
296
|
}
|
|
@@ -299,23 +299,23 @@ class H {
|
|
|
299
299
|
case 12:
|
|
300
300
|
case 13: {
|
|
301
301
|
const e = { offset: this.offset }, r = A(this.payload, e, "DictMalformed");
|
|
302
|
-
|
|
302
|
+
f(this.payload, e.offset, r);
|
|
303
303
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
304
|
-
return this.offset = e.offset + r, new
|
|
304
|
+
return this.offset = e.offset + r, new S(this.valueType, s);
|
|
305
305
|
}
|
|
306
306
|
case 11: {
|
|
307
307
|
const e = { offset: this.offset }, r = A(this.payload, e, "DictMalformed");
|
|
308
|
-
|
|
308
|
+
f(this.payload, e.offset, r);
|
|
309
309
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
310
|
-
return this.offset = e.offset + r, new
|
|
310
|
+
return this.offset = e.offset + r, new S(11, s);
|
|
311
311
|
}
|
|
312
312
|
case 9: {
|
|
313
313
|
const e = Y(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
314
|
-
return this.offset += e, new
|
|
314
|
+
return this.offset += e, new S(9, r);
|
|
315
315
|
}
|
|
316
316
|
case 10: {
|
|
317
317
|
const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
318
|
-
return this.offset += e, new
|
|
318
|
+
return this.offset += e, new S(10, r);
|
|
319
319
|
}
|
|
320
320
|
case 3:
|
|
321
321
|
case 5:
|
|
@@ -326,17 +326,17 @@ class H {
|
|
|
326
326
|
case 6:
|
|
327
327
|
case 14:
|
|
328
328
|
case 1: {
|
|
329
|
-
const e =
|
|
330
|
-
|
|
329
|
+
const e = d(this.valueType);
|
|
330
|
+
f(this.payload, this.offset, e);
|
|
331
331
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
332
|
-
return this.offset += e, new
|
|
332
|
+
return this.offset += e, new S(this.valueType, r);
|
|
333
333
|
}
|
|
334
334
|
default:
|
|
335
335
|
throw new Error(`Unsupported dictionary value type ${D[this.valueType]}`);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
class
|
|
339
|
+
class Nt {
|
|
340
340
|
constructor(e, r) {
|
|
341
341
|
this.key = e, this.value = r;
|
|
342
342
|
}
|
|
@@ -418,7 +418,7 @@ function A(t, e, r) {
|
|
|
418
418
|
for (; e.offset < t.length; ) {
|
|
419
419
|
const i = t[e.offset++];
|
|
420
420
|
if (a++, s |= (i & 127) << n, (i & 128) === 0) {
|
|
421
|
-
if (a !==
|
|
421
|
+
if (a !== St(s))
|
|
422
422
|
throw new Error("Teleport VarUInt is not canonical");
|
|
423
423
|
return s >>> 0;
|
|
424
424
|
}
|
|
@@ -427,10 +427,10 @@ function A(t, e, r) {
|
|
|
427
427
|
}
|
|
428
428
|
throw new Error(r);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function St(t) {
|
|
431
431
|
return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function d(t) {
|
|
434
434
|
switch (t) {
|
|
435
435
|
case 3:
|
|
436
436
|
case 5:
|
|
@@ -454,11 +454,11 @@ function et(t) {
|
|
|
454
454
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
455
455
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function f(t, e, r) {
|
|
458
458
|
if (e < 0 || r < 0 || e + r > t.length)
|
|
459
459
|
throw new Error("Teleport payload exceeds bounds");
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function Ct(t, e) {
|
|
462
462
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0;
|
|
463
463
|
}
|
|
464
464
|
function Y(t, e) {
|
|
@@ -467,14 +467,14 @@ function Y(t, e) {
|
|
|
467
467
|
const r = t[e], s = r >> 4 & 15;
|
|
468
468
|
if ((r & 15) !== 0)
|
|
469
469
|
throw new Error("Array flags must be zero");
|
|
470
|
-
const n = { offset: e + 1 }, a = A(t, n, "ArrayMalformed"), i =
|
|
470
|
+
const n = { offset: e + 1 }, a = A(t, n, "ArrayMalformed"), i = d(s);
|
|
471
471
|
if (i >= 0) {
|
|
472
472
|
const _ = i * a;
|
|
473
|
-
return
|
|
473
|
+
return f(t, n.offset, _), n.offset + _ - e;
|
|
474
474
|
}
|
|
475
475
|
let o = n.offset;
|
|
476
476
|
for (let _ = 0; _ < a; _++)
|
|
477
|
-
o =
|
|
477
|
+
o = p(s, t, o, "ArrayMalformed");
|
|
478
478
|
return o - e;
|
|
479
479
|
}
|
|
480
480
|
function K(t, e) {
|
|
@@ -487,22 +487,22 @@ function K(t, e) {
|
|
|
487
487
|
const n = { offset: e + 2 }, a = A(t, n, "DictMalformed");
|
|
488
488
|
let i = n.offset;
|
|
489
489
|
for (let o = 0; o < a; o++)
|
|
490
|
-
i =
|
|
490
|
+
i = p(r, t, i, "DictMalformed"), i = p(s, t, i, "DictMalformed");
|
|
491
491
|
return i - e;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
const n =
|
|
493
|
+
function p(t, e, r, s) {
|
|
494
|
+
const n = d(t);
|
|
495
495
|
if (n >= 0)
|
|
496
|
-
return
|
|
496
|
+
return f(e, r, n), r + n;
|
|
497
497
|
switch (t) {
|
|
498
498
|
case 12:
|
|
499
499
|
case 13: {
|
|
500
500
|
const a = { offset: r }, i = A(e, a, s);
|
|
501
|
-
return
|
|
501
|
+
return f(e, a.offset, i), a.offset + i;
|
|
502
502
|
}
|
|
503
503
|
case 11: {
|
|
504
504
|
const a = { offset: r }, i = A(e, a, s);
|
|
505
|
-
return
|
|
505
|
+
return f(e, a.offset, i), a.offset + i;
|
|
506
506
|
}
|
|
507
507
|
case 9:
|
|
508
508
|
return r + Y(e, r);
|
|
@@ -518,128 +518,233 @@ function z(t) {
|
|
|
518
518
|
function F(t) {
|
|
519
519
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
520
520
|
}
|
|
521
|
-
var
|
|
522
|
-
const
|
|
523
|
-
function
|
|
521
|
+
var c = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(c || {}), G = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(G || {});
|
|
522
|
+
const Rt = 1, Ut = 4194309, mt = 205938238, Lt = 717315017, yt = 1594075008, Dt = 2026534360, dt = 3409001585, Pt = 3466650495, wt = 4007456593, Ot = 4017217601, gt = 4065417427, Mt = 4086360332;
|
|
523
|
+
function Ft(t) {
|
|
524
524
|
const e = {};
|
|
525
525
|
return rt(e), e;
|
|
526
526
|
}
|
|
527
527
|
function rt(t) {
|
|
528
|
-
return t.Samples = new Uint8Array(0), t.Epoch = 0, t.Sequence = 0, t.FrameSizeInInterleavedSamples = 0, t.TimeStampInInterleavedSamples = 0n, t.IsFirst = !1, t.IsLast = !1, t.AverageVolume = 0, t.AudioEventEstimatedDuration = 0, t;
|
|
528
|
+
return t.Samples = new Uint8Array(0), t.Epoch = 0, t.Sequence = 0, t.FrameSizeInInterleavedSamples = 0, t.TimeStampInInterleavedSamples = 0n, t.IsFirst = !1, t.IsLast = !1, t.AverageVolume = 0, t.AudioEventEstimatedDuration = 0, t.ShapeSetValues = void 0, t;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function Bt(t, e) {
|
|
531
531
|
const r = M.create(t);
|
|
532
|
-
return
|
|
532
|
+
return bt(r, e);
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
const r = e ??
|
|
536
|
-
return rt(r),
|
|
534
|
+
function bt(t, e) {
|
|
535
|
+
const r = e ?? Ft();
|
|
536
|
+
return rt(r), Gt(t, r), r;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function Gt(t, e) {
|
|
539
539
|
let r;
|
|
540
540
|
for (; (r = t.next()) !== null; )
|
|
541
541
|
switch (r.fieldId) {
|
|
542
|
-
case
|
|
542
|
+
case mt: {
|
|
543
543
|
if (r.isNull) throw new Error();
|
|
544
544
|
e.AverageVolume = r.asFloat32();
|
|
545
545
|
break;
|
|
546
546
|
}
|
|
547
|
-
case
|
|
547
|
+
case Lt: {
|
|
548
|
+
if (r.isNull) {
|
|
549
|
+
e.ShapeSetValues = void 0;
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
e.ShapeSetValues = vt(r.asArray());
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
case yt: {
|
|
548
556
|
if (r.isNull) throw new Error();
|
|
549
557
|
e.IsFirst = r.asBool();
|
|
550
558
|
break;
|
|
551
559
|
}
|
|
552
|
-
case
|
|
560
|
+
case Dt: {
|
|
553
561
|
if (r.isNull) throw new Error();
|
|
554
562
|
e.TimeStampInInterleavedSamples = r.asUInt64();
|
|
555
563
|
break;
|
|
556
564
|
}
|
|
557
|
-
case
|
|
565
|
+
case dt: {
|
|
558
566
|
if (r.isNull) throw new Error();
|
|
559
567
|
e.Samples = r.asBinary();
|
|
560
568
|
break;
|
|
561
569
|
}
|
|
562
|
-
case
|
|
570
|
+
case Pt: {
|
|
563
571
|
if (r.isNull) throw new Error();
|
|
564
572
|
e.AudioEventEstimatedDuration = r.asFloat32();
|
|
565
573
|
break;
|
|
566
574
|
}
|
|
567
|
-
case
|
|
575
|
+
case wt: {
|
|
568
576
|
if (r.isNull) throw new Error();
|
|
569
577
|
e.FrameSizeInInterleavedSamples = r.asUInt32();
|
|
570
578
|
break;
|
|
571
579
|
}
|
|
572
|
-
case
|
|
580
|
+
case Ot: {
|
|
573
581
|
if (r.isNull) throw new Error();
|
|
574
582
|
e.IsLast = r.asBool();
|
|
575
583
|
break;
|
|
576
584
|
}
|
|
577
|
-
case
|
|
585
|
+
case gt: {
|
|
578
586
|
if (r.isNull) throw new Error();
|
|
579
587
|
e.Sequence = r.asUInt32();
|
|
580
588
|
break;
|
|
581
589
|
}
|
|
582
|
-
case
|
|
590
|
+
case Mt: {
|
|
583
591
|
if (r.isNull) throw new Error();
|
|
584
592
|
e.Epoch = r.asUInt32();
|
|
585
593
|
break;
|
|
586
594
|
}
|
|
587
595
|
}
|
|
588
596
|
}
|
|
589
|
-
function
|
|
590
|
-
const r = tt(t,
|
|
591
|
-
return
|
|
597
|
+
function Vt(t, e) {
|
|
598
|
+
const r = tt(t, Ut, Rt);
|
|
599
|
+
return Bt(r, e);
|
|
592
600
|
}
|
|
593
|
-
|
|
594
|
-
|
|
601
|
+
function vt(t) {
|
|
602
|
+
const e = [];
|
|
603
|
+
let r;
|
|
604
|
+
for (; (r = t.next()) !== null; )
|
|
605
|
+
e.push(Ht(r.asObject()));
|
|
606
|
+
return e;
|
|
607
|
+
}
|
|
608
|
+
const kt = 1154362099, pt = 3974819915;
|
|
609
|
+
function xt(t) {
|
|
595
610
|
const e = {};
|
|
596
611
|
return st(e), e;
|
|
597
612
|
}
|
|
598
613
|
function st(t) {
|
|
599
|
-
return t.
|
|
614
|
+
return t.SetId = 0, t.Values = [], t;
|
|
615
|
+
}
|
|
616
|
+
function Ht(t, e) {
|
|
617
|
+
const r = e ?? xt();
|
|
618
|
+
return st(r), Yt(t, r), r;
|
|
600
619
|
}
|
|
601
620
|
function Yt(t, e) {
|
|
621
|
+
let r;
|
|
622
|
+
for (; (r = t.next()) !== null; )
|
|
623
|
+
switch (r.fieldId) {
|
|
624
|
+
case kt: {
|
|
625
|
+
if (r.isNull) throw new Error();
|
|
626
|
+
e.SetId = r.asUInt32();
|
|
627
|
+
break;
|
|
628
|
+
}
|
|
629
|
+
case pt: {
|
|
630
|
+
if (r.isNull) throw new Error();
|
|
631
|
+
e.Values = Kt(r.asArray());
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function Kt(t) {
|
|
637
|
+
const e = [];
|
|
638
|
+
let r;
|
|
639
|
+
for (; (r = t.next()) !== null; )
|
|
640
|
+
e.push(r.asFloat32());
|
|
641
|
+
return e;
|
|
642
|
+
}
|
|
643
|
+
const Wt = 1, Xt = 4194305, zt = 265814330, jt = 1368629611, $t = 2431514951, Qt = 2914494629, Jt = 3284746250, Zt = 4101844078;
|
|
644
|
+
function qt(t) {
|
|
645
|
+
const e = {};
|
|
646
|
+
return nt(e), e;
|
|
647
|
+
}
|
|
648
|
+
function nt(t) {
|
|
649
|
+
return t.Description = "", t.Codec = c.Unknown, t.SampleRate = 0, t.Channels = 0, t.BitDepth = 0, t.ShapeSets = void 0, t;
|
|
650
|
+
}
|
|
651
|
+
function te(t, e) {
|
|
602
652
|
const r = M.create(t);
|
|
603
|
-
return
|
|
653
|
+
return ee(r, e);
|
|
604
654
|
}
|
|
605
|
-
function
|
|
606
|
-
const r = e ??
|
|
607
|
-
return
|
|
655
|
+
function ee(t, e) {
|
|
656
|
+
const r = e ?? qt();
|
|
657
|
+
return nt(r), re(t, r), r;
|
|
608
658
|
}
|
|
609
|
-
function
|
|
659
|
+
function re(t, e) {
|
|
610
660
|
let r;
|
|
611
661
|
for (; (r = t.next()) !== null; )
|
|
612
662
|
switch (r.fieldId) {
|
|
613
|
-
case
|
|
663
|
+
case zt: {
|
|
664
|
+
if (r.isNull) {
|
|
665
|
+
e.ShapeSets = void 0;
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
e.ShapeSets = ne(r.asArray());
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
case jt: {
|
|
614
672
|
if (r.isNull) throw new Error();
|
|
615
673
|
e.Description = r.asString();
|
|
616
674
|
break;
|
|
617
675
|
}
|
|
618
|
-
case
|
|
676
|
+
case $t: {
|
|
619
677
|
if (r.isNull) throw new Error();
|
|
620
678
|
e.Channels = r.asInt32();
|
|
621
679
|
break;
|
|
622
680
|
}
|
|
623
|
-
case
|
|
681
|
+
case Qt: {
|
|
624
682
|
if (r.isNull) throw new Error();
|
|
625
683
|
e.BitDepth = r.asInt32();
|
|
626
684
|
break;
|
|
627
685
|
}
|
|
628
|
-
case
|
|
686
|
+
case Jt: {
|
|
629
687
|
if (r.isNull) throw new Error();
|
|
630
688
|
e.Codec = r.asInt32();
|
|
631
689
|
break;
|
|
632
690
|
}
|
|
633
|
-
case
|
|
691
|
+
case Zt: {
|
|
634
692
|
if (r.isNull) throw new Error();
|
|
635
693
|
e.SampleRate = r.asInt32();
|
|
636
694
|
break;
|
|
637
695
|
}
|
|
638
696
|
}
|
|
639
697
|
}
|
|
640
|
-
function
|
|
641
|
-
const r = tt(t,
|
|
642
|
-
return
|
|
698
|
+
function se(t, e) {
|
|
699
|
+
const r = tt(t, Xt, Wt);
|
|
700
|
+
return te(r, e);
|
|
701
|
+
}
|
|
702
|
+
function ne(t) {
|
|
703
|
+
const e = [];
|
|
704
|
+
let r;
|
|
705
|
+
for (; (r = t.next()) !== null; )
|
|
706
|
+
e.push(Ee(r.asObject()));
|
|
707
|
+
return e;
|
|
708
|
+
}
|
|
709
|
+
const ie = 1107713536, ae = 1154362099, oe = 1185721362;
|
|
710
|
+
function _e(t) {
|
|
711
|
+
const e = {};
|
|
712
|
+
return it(e), e;
|
|
713
|
+
}
|
|
714
|
+
function it(t) {
|
|
715
|
+
return t.SetId = 0, t.Name = "", t.ShapeNames = [], t;
|
|
716
|
+
}
|
|
717
|
+
function Ee(t, e) {
|
|
718
|
+
const r = e ?? _e();
|
|
719
|
+
return it(r), le(t, r), r;
|
|
720
|
+
}
|
|
721
|
+
function le(t, e) {
|
|
722
|
+
let r;
|
|
723
|
+
for (; (r = t.next()) !== null; )
|
|
724
|
+
switch (r.fieldId) {
|
|
725
|
+
case ie: {
|
|
726
|
+
if (r.isNull) throw new Error();
|
|
727
|
+
e.Name = r.asString();
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
case ae: {
|
|
731
|
+
if (r.isNull) throw new Error();
|
|
732
|
+
e.SetId = r.asUInt32();
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
case oe: {
|
|
736
|
+
if (r.isNull) throw new Error();
|
|
737
|
+
e.ShapeNames = Ie(r.asArray());
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
function Ie(t) {
|
|
743
|
+
const e = [];
|
|
744
|
+
let r;
|
|
745
|
+
for (; (r = t.next()) !== null; )
|
|
746
|
+
e.push(r.asString());
|
|
747
|
+
return e;
|
|
643
748
|
}
|
|
644
749
|
class j {
|
|
645
750
|
static getStorageForCapacity(e, r) {
|
|
@@ -695,9 +800,9 @@ class j {
|
|
|
695
800
|
return s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
|
|
696
801
|
}
|
|
697
802
|
}
|
|
698
|
-
const
|
|
699
|
-
function
|
|
700
|
-
if (typeof SharedArrayBuffer > "u" || typeof Atomics > "u" ||
|
|
803
|
+
const ue = globalThis;
|
|
804
|
+
function he() {
|
|
805
|
+
if (typeof SharedArrayBuffer > "u" || typeof Atomics > "u" || ue.crossOriginIsolated === !1)
|
|
701
806
|
return !1;
|
|
702
807
|
try {
|
|
703
808
|
new SharedArrayBuffer(1);
|
|
@@ -706,13 +811,13 @@ function jt() {
|
|
|
706
811
|
}
|
|
707
812
|
return !0;
|
|
708
813
|
}
|
|
709
|
-
let
|
|
710
|
-
function
|
|
814
|
+
let fe = 1;
|
|
815
|
+
function Ae(t, e) {
|
|
711
816
|
return `[${t}] ${e}`;
|
|
712
817
|
}
|
|
713
818
|
function b(t, e, r, s) {
|
|
714
|
-
if ((/* @__PURE__ */ new Date()).toISOString(),
|
|
715
|
-
const n =
|
|
819
|
+
if ((/* @__PURE__ */ new Date()).toISOString(), fe <= t) {
|
|
820
|
+
const n = Ae(e, r);
|
|
716
821
|
switch (t) {
|
|
717
822
|
case 0:
|
|
718
823
|
console.debug(n, ...s);
|
|
@@ -729,7 +834,7 @@ function b(t, e, r, s) {
|
|
|
729
834
|
}
|
|
730
835
|
}
|
|
731
836
|
}
|
|
732
|
-
function
|
|
837
|
+
function ce(t) {
|
|
733
838
|
return {
|
|
734
839
|
debug(e, ...r) {
|
|
735
840
|
b(0, t, e, r);
|
|
@@ -745,19 +850,19 @@ function Jt(t) {
|
|
|
745
850
|
}
|
|
746
851
|
};
|
|
747
852
|
}
|
|
748
|
-
const
|
|
853
|
+
const at = 48e3, ot = 2, Te = 1500, Ne = 10, $ = 80, Se = 50, Q = 64, Ce = ce("AudioPlaybackWorker"), P = (t, e) => {
|
|
749
854
|
self.postMessage(t, e ?? []);
|
|
750
|
-
},
|
|
751
|
-
let V = "pcm",
|
|
855
|
+
}, Re = he();
|
|
856
|
+
let V = "pcm", _t = !0, R = at, C = ot, y = null;
|
|
752
857
|
function L(t, e) {
|
|
753
858
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
754
|
-
|
|
859
|
+
P({ type: "error", error: { name: r.name, message: r.message, stack: r.stack }, streamId: e });
|
|
755
860
|
}
|
|
756
861
|
function W(t) {
|
|
757
862
|
const e = q(t);
|
|
758
863
|
return `${e.senderId}_${e.trackId}`;
|
|
759
864
|
}
|
|
760
|
-
class
|
|
865
|
+
class Ue {
|
|
761
866
|
mode;
|
|
762
867
|
ring = null;
|
|
763
868
|
sab = void 0;
|
|
@@ -770,7 +875,7 @@ class se {
|
|
|
770
875
|
pcmBatchOffset = 0;
|
|
771
876
|
lastPcmFlushTimeMs = 0;
|
|
772
877
|
constructor(e) {
|
|
773
|
-
this.streamId = e, this.mode = "pcm", this.outputSampleRate = R, this.outputChannels =
|
|
878
|
+
this.streamId = e, this.mode = "pcm", this.outputSampleRate = R, this.outputChannels = C, this.rebind(V);
|
|
774
879
|
}
|
|
775
880
|
close() {
|
|
776
881
|
this.closed = !0, this.pcmBatchBuffer = null, this.pcmBatchOffset = 0, this.ring = null, this.sab = void 0;
|
|
@@ -780,8 +885,8 @@ class se {
|
|
|
780
885
|
}
|
|
781
886
|
rebind(e) {
|
|
782
887
|
if (!this.closed) {
|
|
783
|
-
if (this.mode = e, e === "sab" &&
|
|
784
|
-
const r = Math.floor(
|
|
888
|
+
if (this.mode = e, e === "sab" && Re) {
|
|
889
|
+
const r = Math.floor(Te * this.outputSampleRate * this.outputChannels / 1e3), s = j.getStorageForCapacity(r, Float32Array), n = new j(s, Float32Array);
|
|
785
890
|
n.flush(), this.sab = s, this.ring = n;
|
|
786
891
|
return;
|
|
787
892
|
}
|
|
@@ -792,10 +897,10 @@ class se {
|
|
|
792
897
|
if (this.closed || this.mode !== "pcm" || this.pcmBatchOffset <= 0)
|
|
793
898
|
return;
|
|
794
899
|
const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * $ / 1e3));
|
|
795
|
-
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >=
|
|
900
|
+
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Se))
|
|
796
901
|
return;
|
|
797
902
|
const a = new Float32Array(this.pcmBatchOffset);
|
|
798
|
-
a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r,
|
|
903
|
+
a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r, P({ type: "pcm", streamId: this.streamId, pcm: a }, [a.buffer]);
|
|
799
904
|
}
|
|
800
905
|
drainPcm() {
|
|
801
906
|
this.flushPendingPcm(!0);
|
|
@@ -828,18 +933,18 @@ class se {
|
|
|
828
933
|
this.closed || (this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = 0, this.ring?.flush());
|
|
829
934
|
}
|
|
830
935
|
}
|
|
831
|
-
function
|
|
936
|
+
function me(t) {
|
|
832
937
|
switch (t) {
|
|
833
|
-
case
|
|
938
|
+
case c.Opus:
|
|
834
939
|
return "opus";
|
|
835
|
-
case
|
|
940
|
+
case c.Mp3:
|
|
836
941
|
return "mp3";
|
|
837
942
|
default:
|
|
838
943
|
return null;
|
|
839
944
|
}
|
|
840
945
|
}
|
|
841
946
|
let g = null;
|
|
842
|
-
function
|
|
947
|
+
function Le(t) {
|
|
843
948
|
const e = new DataView(t.buffer, t.byteOffset, t.byteLength), r = Math.floor(t.byteLength / 2);
|
|
844
949
|
(!g || g.length < r) && (g = new Float32Array(r));
|
|
845
950
|
for (let s = 0; s < r; s++)
|
|
@@ -875,12 +980,12 @@ class X {
|
|
|
875
980
|
convertAudioData(e) {
|
|
876
981
|
const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format, a = typeof n == "string" && n.includes("planar"), i = "f32-planar", o = "f32", _ = () => {
|
|
877
982
|
const E = new Array(s);
|
|
878
|
-
for (let
|
|
983
|
+
for (let h = 0; h < s; h++) {
|
|
879
984
|
const N = new Float32Array(r);
|
|
880
|
-
e.copyTo(N, { planeIndex:
|
|
985
|
+
e.copyTo(N, { planeIndex: h, format: i }), E[h] = N;
|
|
881
986
|
}
|
|
882
|
-
return
|
|
883
|
-
},
|
|
987
|
+
return Ge(E, r);
|
|
988
|
+
}, u = () => {
|
|
884
989
|
const E = new Float32Array(r * s);
|
|
885
990
|
return e.copyTo(E, { planeIndex: 0, format: o }), E;
|
|
886
991
|
};
|
|
@@ -889,10 +994,10 @@ class X {
|
|
|
889
994
|
try {
|
|
890
995
|
l = _();
|
|
891
996
|
} catch (E) {
|
|
892
|
-
|
|
997
|
+
Ce.debug(`Failed to read planar audio data, falling back to interleaved copy: ${E}`), l = u();
|
|
893
998
|
}
|
|
894
999
|
else
|
|
895
|
-
l =
|
|
1000
|
+
l = u();
|
|
896
1001
|
return l;
|
|
897
1002
|
}
|
|
898
1003
|
convertPcmBuffer(e, r, s) {
|
|
@@ -900,26 +1005,26 @@ class X {
|
|
|
900
1005
|
return e;
|
|
901
1006
|
let n = e, a = e.length, i = r;
|
|
902
1007
|
if (s !== R) {
|
|
903
|
-
const o = a / i,
|
|
904
|
-
a =
|
|
1008
|
+
const o = a / i, u = Math.max(1, Math.round(o * R / s)) * i, l = this.getResampleBuffer(u);
|
|
1009
|
+
a = ve(n, l, i, s, R), n = l;
|
|
905
1010
|
}
|
|
906
|
-
if (i !==
|
|
907
|
-
const _ = a / i *
|
|
908
|
-
a =
|
|
1011
|
+
if (i !== C) {
|
|
1012
|
+
const _ = a / i * C, u = this.getRemixBuffer(_);
|
|
1013
|
+
a = ke(n.subarray(0, a), u, i, C), n = u, i = C;
|
|
909
1014
|
}
|
|
910
1015
|
return n.subarray(0, a);
|
|
911
1016
|
}
|
|
912
1017
|
}
|
|
913
|
-
class
|
|
1018
|
+
class ye extends X {
|
|
914
1019
|
feedChunk(e) {
|
|
915
1020
|
e.isFirst && this.reset();
|
|
916
|
-
const r =
|
|
1021
|
+
const r = Le(e.data);
|
|
917
1022
|
this.writeConvertedPcm(r, this.inputChannels, this.inputSampleRate), e.isLast && this.reset();
|
|
918
1023
|
}
|
|
919
1024
|
close() {
|
|
920
1025
|
}
|
|
921
1026
|
}
|
|
922
|
-
class
|
|
1027
|
+
class De extends X {
|
|
923
1028
|
decoder;
|
|
924
1029
|
codec;
|
|
925
1030
|
constructor(e) {
|
|
@@ -978,7 +1083,7 @@ class oe extends X {
|
|
|
978
1083
|
}
|
|
979
1084
|
}
|
|
980
1085
|
}
|
|
981
|
-
class
|
|
1086
|
+
class de extends X {
|
|
982
1087
|
decoder = null;
|
|
983
1088
|
isReady = !1;
|
|
984
1089
|
decoderSampleRate = 48e3;
|
|
@@ -1018,16 +1123,16 @@ class _e extends X {
|
|
|
1018
1123
|
return;
|
|
1019
1124
|
const o = a * i, _ = this.getInterleavedBuffer(o);
|
|
1020
1125
|
if (i === 2) {
|
|
1021
|
-
const
|
|
1022
|
-
for (let E = 0,
|
|
1023
|
-
_[
|
|
1126
|
+
const u = n[0], l = n[1];
|
|
1127
|
+
for (let E = 0, h = 0; E < a; E++)
|
|
1128
|
+
_[h++] = u[E], _[h++] = l[E];
|
|
1024
1129
|
} else if (i === 1)
|
|
1025
1130
|
_.set(n[0].subarray(0, a));
|
|
1026
1131
|
else {
|
|
1027
|
-
let
|
|
1132
|
+
let u = 0;
|
|
1028
1133
|
for (let l = 0; l < a; l++)
|
|
1029
1134
|
for (let E = 0; E < i; E++)
|
|
1030
|
-
_[
|
|
1135
|
+
_[u++] = n[E][l];
|
|
1031
1136
|
}
|
|
1032
1137
|
this.writeConvertedPcm(_.subarray(0, o), i, this.decoderSampleRate), e.isLast && this.reset();
|
|
1033
1138
|
} catch (r) {
|
|
@@ -1049,21 +1154,21 @@ class _e extends X {
|
|
|
1049
1154
|
this.decoder = null, this.pendingChunks.length = 0;
|
|
1050
1155
|
}
|
|
1051
1156
|
}
|
|
1052
|
-
const
|
|
1053
|
-
async function
|
|
1157
|
+
const T = /* @__PURE__ */ new Map();
|
|
1158
|
+
async function Pe(t) {
|
|
1054
1159
|
if (t.closed || t.decoder)
|
|
1055
1160
|
return;
|
|
1056
|
-
if (t.codec ===
|
|
1057
|
-
t.decoder = new
|
|
1161
|
+
if (t.codec === c.RawPcm16) {
|
|
1162
|
+
t.decoder = new ye({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1058
1163
|
return;
|
|
1059
1164
|
}
|
|
1060
|
-
if (t.codec !==
|
|
1061
|
-
throw new Error(`Unsupported audio codec: ${
|
|
1062
|
-
const e =
|
|
1063
|
-
if (
|
|
1165
|
+
if (t.codec !== c.Opus && t.codec !== c.Mp3)
|
|
1166
|
+
throw new Error(`Unsupported audio codec: ${c[t.codec] ?? t.codec}`);
|
|
1167
|
+
const e = me(t.codec);
|
|
1168
|
+
if (_t && typeof AudioDecoder < "u" && e !== null)
|
|
1064
1169
|
try {
|
|
1065
1170
|
if ((await AudioDecoder.isConfigSupported({ codec: e, numberOfChannels: t.inputChannels, sampleRate: t.inputSampleRate })).supported) {
|
|
1066
|
-
const n = new
|
|
1171
|
+
const n = new De({
|
|
1067
1172
|
codec: e,
|
|
1068
1173
|
inputChannels: t.inputChannels,
|
|
1069
1174
|
inputSampleRate: t.inputSampleRate,
|
|
@@ -1078,8 +1183,8 @@ async function Ee(t) {
|
|
|
1078
1183
|
}
|
|
1079
1184
|
} catch {
|
|
1080
1185
|
}
|
|
1081
|
-
if (t.codec ===
|
|
1082
|
-
const s = new
|
|
1186
|
+
if (t.codec === c.Opus) {
|
|
1187
|
+
const s = new de({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1083
1188
|
if (await s.initialise(t.inputChannels, t.inputSampleRate), t.closed) {
|
|
1084
1189
|
s.close();
|
|
1085
1190
|
return;
|
|
@@ -1087,9 +1192,9 @@ async function Ee(t) {
|
|
|
1087
1192
|
t.decoder = s;
|
|
1088
1193
|
return;
|
|
1089
1194
|
}
|
|
1090
|
-
throw new Error(`No available decoder for codec: ${
|
|
1195
|
+
throw new Error(`No available decoder for codec: ${c[t.codec] ?? t.codec}`);
|
|
1091
1196
|
}
|
|
1092
|
-
function
|
|
1197
|
+
function we(t) {
|
|
1093
1198
|
if (t.closed) {
|
|
1094
1199
|
t.pendingFrames.splice(0);
|
|
1095
1200
|
try {
|
|
@@ -1103,33 +1208,34 @@ function le(t) {
|
|
|
1103
1208
|
return;
|
|
1104
1209
|
const e = t.pendingFrames.splice(0);
|
|
1105
1210
|
for (const r of e)
|
|
1106
|
-
|
|
1211
|
+
Et(t, r);
|
|
1107
1212
|
}
|
|
1108
|
-
function
|
|
1213
|
+
function Et(t, e) {
|
|
1109
1214
|
if (t.closed || !t.decoder)
|
|
1110
1215
|
return;
|
|
1111
1216
|
const r = e.Epoch, s = Number(e.TimeStampInInterleavedSamples), n = e.FrameSizeInInterleavedSamples;
|
|
1112
1217
|
if (t.currentEpoch !== r && (t.currentEpoch = r, t.epochSet = !1, t.lastArrivalTimeMs = 0, t.jitterMs = 0, t.sink.flush(), t.decoder.reset()), !t.epochSet) {
|
|
1113
1218
|
t.epochSet = !0;
|
|
1114
|
-
const
|
|
1115
|
-
t.expectedIntervalMs = n * 1e3 /
|
|
1219
|
+
const h = t.inputSampleRate * t.inputChannels;
|
|
1220
|
+
t.expectedIntervalMs = n * 1e3 / h;
|
|
1116
1221
|
}
|
|
1117
1222
|
const a = performance.now();
|
|
1118
1223
|
if (t.lastArrivalTimeMs > 0) {
|
|
1119
|
-
const
|
|
1120
|
-
t.jitterMs = t.jitterMs + (N - t.jitterMs) /
|
|
1224
|
+
const h = a - t.lastArrivalTimeMs, N = Math.abs(h - t.expectedIntervalMs);
|
|
1225
|
+
t.jitterMs = t.jitterMs + (N - t.jitterMs) / Ne;
|
|
1121
1226
|
}
|
|
1122
1227
|
t.lastArrivalTimeMs = a;
|
|
1123
|
-
const i = t.inputSampleRate * t.inputChannels, o = R *
|
|
1124
|
-
|
|
1228
|
+
const i = t.inputSampleRate * t.inputChannels, o = R * C, _ = Math.round(s * o / i), u = Math.round(n * o / i), l = Math.round(s * 1e6 / i), E = Math.round(n * 1e6 / i);
|
|
1229
|
+
P({
|
|
1125
1230
|
type: "frame",
|
|
1126
1231
|
streamId: t.streamId,
|
|
1127
1232
|
epoch: r,
|
|
1128
1233
|
timestampInterleavedSamples: _,
|
|
1129
|
-
frameSizeInterleavedSamples:
|
|
1234
|
+
frameSizeInterleavedSamples: u,
|
|
1130
1235
|
isFirst: e.IsFirst,
|
|
1131
1236
|
isLast: e.IsLast,
|
|
1132
|
-
jitterMs: t.jitterMs
|
|
1237
|
+
jitterMs: t.jitterMs,
|
|
1238
|
+
shapeSetValues: e.ShapeSetValues
|
|
1133
1239
|
}), t.decoder.feedChunk({
|
|
1134
1240
|
data: e.Samples,
|
|
1135
1241
|
isFirst: e.IsFirst,
|
|
@@ -1138,8 +1244,8 @@ function ot(t, e) {
|
|
|
1138
1244
|
durationUs: E
|
|
1139
1245
|
});
|
|
1140
1246
|
}
|
|
1141
|
-
function
|
|
1142
|
-
const e = W(t), r =
|
|
1247
|
+
function Oe(t) {
|
|
1248
|
+
const e = W(t), r = se(t), s = T.get(e);
|
|
1143
1249
|
if (s) {
|
|
1144
1250
|
s.closed = !0, s.pendingFrames.splice(0);
|
|
1145
1251
|
try {
|
|
@@ -1150,9 +1256,9 @@ function Ie(t) {
|
|
|
1150
1256
|
s.sink.drainPcm(), s.sink.close();
|
|
1151
1257
|
} catch {
|
|
1152
1258
|
}
|
|
1153
|
-
|
|
1259
|
+
T.delete(e);
|
|
1154
1260
|
}
|
|
1155
|
-
const n = new
|
|
1261
|
+
const n = new Ue(e), a = {
|
|
1156
1262
|
streamId: e,
|
|
1157
1263
|
codec: r.Codec,
|
|
1158
1264
|
inputSampleRate: r.SampleRate,
|
|
@@ -1166,24 +1272,27 @@ function Ie(t) {
|
|
|
1166
1272
|
closed: !1,
|
|
1167
1273
|
lastArrivalTimeMs: 0,
|
|
1168
1274
|
jitterMs: 0,
|
|
1169
|
-
expectedIntervalMs: 20
|
|
1275
|
+
expectedIntervalMs: 20,
|
|
1276
|
+
shapeSets: r.ShapeSets
|
|
1170
1277
|
};
|
|
1171
|
-
|
|
1278
|
+
T.set(e, a), P({
|
|
1172
1279
|
type: "streamBegin",
|
|
1173
1280
|
streamId: e,
|
|
1174
|
-
sharedArrayBuffer: n.getSharedArrayBuffer()
|
|
1281
|
+
sharedArrayBuffer: n.getSharedArrayBuffer(),
|
|
1282
|
+
shapeSets: r.ShapeSets
|
|
1175
1283
|
});
|
|
1176
1284
|
}
|
|
1177
|
-
function
|
|
1178
|
-
for (const t of
|
|
1179
|
-
|
|
1285
|
+
function ge() {
|
|
1286
|
+
for (const t of T.values())
|
|
1287
|
+
P({
|
|
1180
1288
|
type: "streamBegin",
|
|
1181
1289
|
streamId: t.streamId,
|
|
1182
|
-
sharedArrayBuffer: t.sink.getSharedArrayBuffer()
|
|
1290
|
+
sharedArrayBuffer: t.sink.getSharedArrayBuffer(),
|
|
1291
|
+
shapeSets: t.shapeSets
|
|
1183
1292
|
});
|
|
1184
1293
|
}
|
|
1185
|
-
function
|
|
1186
|
-
const e = W(t), r =
|
|
1294
|
+
function Me(t) {
|
|
1295
|
+
const e = W(t), r = T.get(e);
|
|
1187
1296
|
if (r) {
|
|
1188
1297
|
r.closed = !0, r.pendingFrames.splice(0);
|
|
1189
1298
|
try {
|
|
@@ -1194,38 +1303,38 @@ function fe(t) {
|
|
|
1194
1303
|
r.decoder?.close();
|
|
1195
1304
|
} catch {
|
|
1196
1305
|
}
|
|
1197
|
-
r.decoder = null,
|
|
1306
|
+
r.decoder = null, T.delete(e), P({ type: "streamEnd", streamId: e });
|
|
1198
1307
|
}
|
|
1199
1308
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const e = W(t), r =
|
|
1309
|
+
function Fe(t) {
|
|
1310
|
+
const e = W(t), r = T.get(e);
|
|
1202
1311
|
if (!r || r.closed)
|
|
1203
1312
|
return;
|
|
1204
|
-
const s =
|
|
1313
|
+
const s = Vt(t);
|
|
1205
1314
|
if (!r.decoder) {
|
|
1206
|
-
r.pendingFrames.length >= Q && r.pendingFrames.splice(0, r.pendingFrames.length - Q + 1), r.pendingFrames.push(s), r.initTask || (r.initTask =
|
|
1315
|
+
r.pendingFrames.length >= Q && r.pendingFrames.splice(0, r.pendingFrames.length - Q + 1), r.pendingFrames.push(s), r.initTask || (r.initTask = Pe(r).then(() => we(r)).catch((n) => {
|
|
1207
1316
|
r.closed || L(n, e);
|
|
1208
1317
|
}));
|
|
1209
1318
|
return;
|
|
1210
1319
|
}
|
|
1211
|
-
|
|
1320
|
+
Et(r, s);
|
|
1212
1321
|
}
|
|
1213
|
-
function
|
|
1214
|
-
switch (
|
|
1322
|
+
function Be(t) {
|
|
1323
|
+
switch (ht(t)) {
|
|
1215
1324
|
case G.AUDIO_STREAM_BEGIN:
|
|
1216
|
-
|
|
1325
|
+
Oe(t);
|
|
1217
1326
|
return;
|
|
1218
1327
|
case G.AUDIO_STREAM_END:
|
|
1219
|
-
|
|
1328
|
+
Me(t);
|
|
1220
1329
|
return;
|
|
1221
1330
|
case G.AUDIO_FRAME2:
|
|
1222
|
-
|
|
1331
|
+
Fe(t);
|
|
1223
1332
|
return;
|
|
1224
1333
|
default:
|
|
1225
1334
|
return;
|
|
1226
1335
|
}
|
|
1227
1336
|
}
|
|
1228
|
-
function
|
|
1337
|
+
function lt() {
|
|
1229
1338
|
if (y) {
|
|
1230
1339
|
try {
|
|
1231
1340
|
y.close();
|
|
@@ -1234,9 +1343,9 @@ function _t() {
|
|
|
1234
1343
|
y = null;
|
|
1235
1344
|
}
|
|
1236
1345
|
}
|
|
1237
|
-
function
|
|
1238
|
-
|
|
1239
|
-
for (const t of
|
|
1346
|
+
function be() {
|
|
1347
|
+
lt();
|
|
1348
|
+
for (const t of T.values()) {
|
|
1240
1349
|
try {
|
|
1241
1350
|
t.sink.drainPcm(), t.sink.close();
|
|
1242
1351
|
} catch {
|
|
@@ -1246,32 +1355,32 @@ function Te() {
|
|
|
1246
1355
|
} catch {
|
|
1247
1356
|
}
|
|
1248
1357
|
}
|
|
1249
|
-
|
|
1358
|
+
T.clear();
|
|
1250
1359
|
}
|
|
1251
1360
|
self.addEventListener("message", (t) => {
|
|
1252
1361
|
const e = t.data;
|
|
1253
1362
|
if (e.type === "configure") {
|
|
1254
|
-
V = e.transport,
|
|
1363
|
+
V = e.transport, _t = e.preferWebCodecs ?? !0, R = Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 ? e.outputSampleRate : at, C = Number.isFinite(e.outputChannels) && e.outputChannels > 0 ? e.outputChannels : ot;
|
|
1255
1364
|
return;
|
|
1256
1365
|
}
|
|
1257
1366
|
if (e.type === "attachProtocolPort") {
|
|
1258
|
-
|
|
1367
|
+
lt(), y = e.port, y.addEventListener("message", (r) => {
|
|
1259
1368
|
const s = r.data;
|
|
1260
|
-
s?.type === "protocol" && s.message instanceof ArrayBuffer &&
|
|
1261
|
-
});
|
|
1369
|
+
s?.type === "protocol" && s.message instanceof ArrayBuffer && Be(new Uint8Array(s.message));
|
|
1370
|
+
}), y.start?.();
|
|
1262
1371
|
return;
|
|
1263
1372
|
}
|
|
1264
1373
|
if (e.type === "rebind") {
|
|
1265
|
-
V = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (R = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (
|
|
1266
|
-
for (const r of
|
|
1267
|
-
r.sink.setOutputFormat(R,
|
|
1268
|
-
|
|
1374
|
+
V = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (R = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (C = e.outputChannels);
|
|
1375
|
+
for (const r of T.values())
|
|
1376
|
+
r.sink.setOutputFormat(R, C), r.sink.rebind(V);
|
|
1377
|
+
ge();
|
|
1269
1378
|
return;
|
|
1270
1379
|
}
|
|
1271
|
-
e.type === "dispose" &&
|
|
1380
|
+
e.type === "dispose" && be();
|
|
1272
1381
|
});
|
|
1273
1382
|
let U = null;
|
|
1274
|
-
function
|
|
1383
|
+
function Ge(t, e) {
|
|
1275
1384
|
const r = t.length;
|
|
1276
1385
|
if (r === 1)
|
|
1277
1386
|
return t[0];
|
|
@@ -1295,32 +1404,32 @@ function Z(t) {
|
|
|
1295
1404
|
const e = Math.PI * t;
|
|
1296
1405
|
return Math.sin(e) / e;
|
|
1297
1406
|
}
|
|
1298
|
-
function
|
|
1407
|
+
function Ve(t, e) {
|
|
1299
1408
|
return t === 0 ? 1 : Math.abs(t) >= e ? 0 : Z(t) * Z(t / e);
|
|
1300
1409
|
}
|
|
1301
|
-
function
|
|
1410
|
+
function ve(t, e, r, s, n) {
|
|
1302
1411
|
if (s === n)
|
|
1303
1412
|
return e.set(t), t.length;
|
|
1304
|
-
const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), o = s / n, _ = o > 1 ? o : 1,
|
|
1413
|
+
const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), o = s / n, _ = o > 1 ? o : 1, u = Math.ceil(J * _);
|
|
1305
1414
|
for (let l = 0; l < r; l++)
|
|
1306
1415
|
for (let E = 0; E < i; E++) {
|
|
1307
|
-
const
|
|
1308
|
-
let
|
|
1309
|
-
for (let v = -
|
|
1416
|
+
const h = E * o, N = Math.floor(h);
|
|
1417
|
+
let w = 0, m = 0;
|
|
1418
|
+
for (let v = -u + 1; v <= u; v++) {
|
|
1310
1419
|
const B = N + v;
|
|
1311
1420
|
if (B < 0 || B >= a)
|
|
1312
1421
|
continue;
|
|
1313
|
-
const
|
|
1422
|
+
const It = (h - B) / _, k = Ve(It, J);
|
|
1314
1423
|
if (k !== 0) {
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1424
|
+
const ut = t[B * r + l] ?? 0;
|
|
1425
|
+
w += ut * k, m += k;
|
|
1317
1426
|
}
|
|
1318
1427
|
}
|
|
1319
|
-
e[E * r + l] = m > 0 ?
|
|
1428
|
+
e[E * r + l] = m > 0 ? w / m : 0;
|
|
1320
1429
|
}
|
|
1321
1430
|
return i * r;
|
|
1322
1431
|
}
|
|
1323
|
-
function
|
|
1432
|
+
function ke(t, e, r, s) {
|
|
1324
1433
|
const n = t.length / r;
|
|
1325
1434
|
if (r === s)
|
|
1326
1435
|
return e.set(t), t.length;
|