@codernote/record-tree 2.6.0 → 2.6.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/dist/index.js +519 -515
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -216,7 +216,7 @@ const hr = ["contenteditable"], _r = {
|
|
|
216
216
|
Qt(K.currentTarget, 1 / 0, !0);
|
|
217
217
|
}), le("keydown", K);
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function G(K) {
|
|
220
220
|
le("focus", K);
|
|
221
221
|
}
|
|
222
222
|
function I() {
|
|
@@ -264,7 +264,7 @@ const hr = ["contenteditable"], _r = {
|
|
|
264
264
|
ref: _e,
|
|
265
265
|
contenteditable: !w.readOnly,
|
|
266
266
|
onKeydown: It(ge, ["stop"]),
|
|
267
|
-
onFocusin: It(
|
|
267
|
+
onFocusin: It(G, ["stop"]),
|
|
268
268
|
onClick: It(Le, ["stop"])
|
|
269
269
|
}, [
|
|
270
270
|
et("div", {
|
|
@@ -606,7 +606,7 @@ const ha = (w) => w.tagName.toLowerCase() === "mark", N0 = () => {
|
|
|
606
606
|
H.value.commands.toggleBold();
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function G(I) {
|
|
610
610
|
Le(() => {
|
|
611
611
|
I ? H.value.commands.setColor(I) : H.value.commands.unsetColor();
|
|
612
612
|
});
|
|
@@ -614,7 +614,7 @@ const ha = (w) => w.tagName.toLowerCase() === "mark", N0 = () => {
|
|
|
614
614
|
return Q({
|
|
615
615
|
focus: be,
|
|
616
616
|
bold: ge,
|
|
617
|
-
color:
|
|
617
|
+
color: G
|
|
618
618
|
}), (I, ee) => (st(), jt(Ke(Oa), {
|
|
619
619
|
editor: Ke(H),
|
|
620
620
|
ref_key: "container",
|
|
@@ -654,23 +654,23 @@ const ha = (w) => w.tagName.toLowerCase() === "mark", N0 = () => {
|
|
|
654
654
|
_e("focus", ge);
|
|
655
655
|
}
|
|
656
656
|
function he(ge) {
|
|
657
|
-
const
|
|
657
|
+
const G = {
|
|
658
658
|
...F.data,
|
|
659
659
|
...typeof ge == "string" ? { text: ge } : ge
|
|
660
660
|
}, I = (F.tags || []).map((ee) => ee.name).filter((ee) => !!ee);
|
|
661
|
-
if (!I.length ||
|
|
662
|
-
_e("change",
|
|
661
|
+
if (!I.length || G.type)
|
|
662
|
+
_e("change", G);
|
|
663
663
|
else {
|
|
664
|
-
const ee =
|
|
664
|
+
const ee = G.text.replace(/^<p>/, "").replace(/<\/p>$/, "");
|
|
665
665
|
let Ae = ee;
|
|
666
666
|
I.forEach((T) => {
|
|
667
667
|
const K = new RegExp(`^(${T}[::])`), ve = new RegExp(`([::]${T})$`);
|
|
668
668
|
if (K.test(ee) || ve.test(ee)) {
|
|
669
669
|
Ae = Ae.replace(K, "").replace(ve, "");
|
|
670
670
|
const re = F.tags.find((te) => te.name === T);
|
|
671
|
-
|
|
671
|
+
G.tag_id = re.created_at, G.text = Ae && `<p>${Ae}</p>`;
|
|
672
672
|
}
|
|
673
|
-
}), _e("change",
|
|
673
|
+
}), _e("change", G);
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
function be(ge) {
|
|
@@ -679,14 +679,14 @@ const ha = (w) => w.tagName.toLowerCase() === "mark", N0 = () => {
|
|
|
679
679
|
function Ee(ge) {
|
|
680
680
|
return (ge || "").replace("contenteditable", "temp");
|
|
681
681
|
}
|
|
682
|
-
function Le(ge, ...
|
|
682
|
+
function Le(ge, ...G) {
|
|
683
683
|
var I, ee, Ae, T;
|
|
684
|
-
F.data.type ? (I = le.value) != null && I[ge] && ((ee = le.value) == null || ee[ge](...
|
|
684
|
+
F.data.type ? (I = le.value) != null && I[ge] && ((ee = le.value) == null || ee[ge](...G)) : (Ae = b.value) != null && Ae[ge] && ((T = b.value) == null || T[ge](...G));
|
|
685
685
|
}
|
|
686
686
|
return Q({
|
|
687
687
|
focus,
|
|
688
688
|
dispatch: Le
|
|
689
|
-
}), (ge,
|
|
689
|
+
}), (ge, G) => w.data.type ? (st(), jt(Ke(Mr), {
|
|
690
690
|
key: 0,
|
|
691
691
|
ref_key: "mediaEditor",
|
|
692
692
|
ref: le,
|
|
@@ -798,7 +798,7 @@ const ha = (w) => w.tagName.toLowerCase() === "mark", N0 = () => {
|
|
|
798
798
|
te.preventDefault(), Ae(te, ...Ce);
|
|
799
799
|
break;
|
|
800
800
|
case "Tab":
|
|
801
|
-
|
|
801
|
+
G(te, ...Ce);
|
|
802
802
|
break;
|
|
803
803
|
case "Enter":
|
|
804
804
|
te.preventDefault(), I(te, ...Ce);
|
|
@@ -814,7 +814,7 @@ const ha = (w) => w.tagName.toLowerCase() === "mark", N0 = () => {
|
|
|
814
814
|
const Ce = ae.node;
|
|
815
815
|
te.preventDefault(), !((Ue = Ce.children) != null && Ue.length) && (b("toPrevFocus", Ce, !0), ve());
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function G(te) {
|
|
818
818
|
b("tab", te, ae.node);
|
|
819
819
|
}
|
|
820
820
|
function I(te) {
|
|
@@ -1091,11 +1091,11 @@ const Ir = {
|
|
|
1091
1091
|
M.children = M.children.filter((Ye) => Ye !== Be), Ve.splice(Me + 1, 0, Be), Ie(Ve);
|
|
1092
1092
|
}
|
|
1093
1093
|
function ge(M) {
|
|
1094
|
-
b.enableDbEnter ? F ? (clearTimeout(F), F = null,
|
|
1094
|
+
b.enableDbEnter ? F ? (clearTimeout(F), F = null, G()) : F = setTimeout(() => {
|
|
1095
1095
|
clearTimeout(F), F = null, I(M);
|
|
1096
1096
|
}, 180) : I(M);
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function G() {
|
|
1099
1099
|
le("dbEnter");
|
|
1100
1100
|
}
|
|
1101
1101
|
function I(M) {
|
|
@@ -1287,7 +1287,7 @@ const Ir = {
|
|
|
1287
1287
|
onFocusNext: (Ye) => Ae(Me, Ye),
|
|
1288
1288
|
onTransfer: (Ye) => Le(Me, Ye),
|
|
1289
1289
|
onFileUpload: Be[0] || (Be[0] = (...Ye) => M.$emit("fileUpload", ...Ye)),
|
|
1290
|
-
onDbEnter:
|
|
1290
|
+
onDbEnter: G
|
|
1291
1291
|
}, null, 8, ["nodes", "tags", "enableDbEnter", "hash", "onChange", "onFocusPrev", "onFocusNext", "onTransfer"])) : Ct("", !0)
|
|
1292
1292
|
], 42, Hr))), 128))
|
|
1293
1293
|
])
|
|
@@ -1380,7 +1380,7 @@ const Ir = {
|
|
|
1380
1380
|
const te = { ...F.note }, Ce = +re.created_at;
|
|
1381
1381
|
te.tag_id === Ce ? delete te.tag_id : te.tag_id = Ce, _e("change", te.title, te);
|
|
1382
1382
|
}
|
|
1383
|
-
function
|
|
1383
|
+
function G() {
|
|
1384
1384
|
bt.currentId = "tree_title", we && fa(!1);
|
|
1385
1385
|
}
|
|
1386
1386
|
function I(re) {
|
|
@@ -1511,7 +1511,7 @@ const Ir = {
|
|
|
1511
1511
|
tags: w.tags,
|
|
1512
1512
|
onChange: I,
|
|
1513
1513
|
onRemove: ee,
|
|
1514
|
-
onFocus:
|
|
1514
|
+
onFocus: G,
|
|
1515
1515
|
onClick: te[0] || (te[0] = It(() => {
|
|
1516
1516
|
}, ["stop"])),
|
|
1517
1517
|
onPaste: K,
|
|
@@ -1809,7 +1809,7 @@ function x0() {
|
|
|
1809
1809
|
ve[re >>> 3] |= parseInt(T.substr(re, 2), 16) << 24 - re % 8 * 4;
|
|
1810
1810
|
return new Ee.init(ve, K / 2);
|
|
1811
1811
|
}
|
|
1812
|
-
},
|
|
1812
|
+
}, G = Le.Latin1 = {
|
|
1813
1813
|
/**
|
|
1814
1814
|
* Converts a word array to a Latin1 string.
|
|
1815
1815
|
*
|
|
@@ -1864,7 +1864,7 @@ function x0() {
|
|
|
1864
1864
|
*/
|
|
1865
1865
|
stringify: function(T) {
|
|
1866
1866
|
try {
|
|
1867
|
-
return decodeURIComponent(escape(
|
|
1867
|
+
return decodeURIComponent(escape(G.stringify(T)));
|
|
1868
1868
|
} catch {
|
|
1869
1869
|
throw new Error("Malformed UTF-8 data");
|
|
1870
1870
|
}
|
|
@@ -1883,7 +1883,7 @@ function x0() {
|
|
|
1883
1883
|
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
1884
1884
|
*/
|
|
1885
1885
|
parse: function(T) {
|
|
1886
|
-
return
|
|
1886
|
+
return G.parse(unescape(encodeURIComponent(T)));
|
|
1887
1887
|
}
|
|
1888
1888
|
}, ee = he.BufferedBlockAlgorithm = be.extend({
|
|
1889
1889
|
/**
|
|
@@ -2070,20 +2070,20 @@ function $r() {
|
|
|
2070
2070
|
return !1;
|
|
2071
2071
|
return !0;
|
|
2072
2072
|
}
|
|
2073
|
-
function
|
|
2073
|
+
function G(Ae) {
|
|
2074
2074
|
return (Ae - (Ae | 0)) * 4294967296 | 0;
|
|
2075
2075
|
}
|
|
2076
2076
|
for (var I = 2, ee = 0; ee < 64; )
|
|
2077
|
-
ge(I) && (ee < 8 && (he[ee] =
|
|
2077
|
+
ge(I) && (ee < 8 && (he[ee] = G(b.pow(I, 1 / 2))), be[ee] = G(b.pow(I, 1 / 3)), ee++), I++;
|
|
2078
2078
|
})();
|
|
2079
2079
|
var Ee = [], Le = we.SHA256 = H.extend({
|
|
2080
2080
|
_doReset: function() {
|
|
2081
2081
|
this._hash = new _e.init(he.slice(0));
|
|
2082
2082
|
},
|
|
2083
|
-
_doProcessBlock: function(ge,
|
|
2083
|
+
_doProcessBlock: function(ge, G) {
|
|
2084
2084
|
for (var I = this._hash.words, ee = I[0], Ae = I[1], T = I[2], K = I[3], ve = I[4], re = I[5], te = I[6], Ce = I[7], Ue = 0; Ue < 64; Ue++) {
|
|
2085
2085
|
if (Ue < 16)
|
|
2086
|
-
Ee[Ue] = ge[
|
|
2086
|
+
Ee[Ue] = ge[G + Ue] | 0;
|
|
2087
2087
|
else {
|
|
2088
2088
|
var Pe = Ee[Ue - 15], Je = (Pe << 25 | Pe >>> 7) ^ (Pe << 14 | Pe >>> 18) ^ Pe >>> 3, Ie = Ee[Ue - 2], M = (Ie << 15 | Ie >>> 17) ^ (Ie << 13 | Ie >>> 19) ^ Ie >>> 10;
|
|
2089
2089
|
Ee[Ue] = Je + Ee[Ue - 7] + M + Ee[Ue - 16];
|
|
@@ -2094,8 +2094,8 @@ function $r() {
|
|
|
2094
2094
|
I[0] = I[0] + ee | 0, I[1] = I[1] + Ae | 0, I[2] = I[2] + T | 0, I[3] = I[3] + K | 0, I[4] = I[4] + ve | 0, I[5] = I[5] + re | 0, I[6] = I[6] + te | 0, I[7] = I[7] + Ce | 0;
|
|
2095
2095
|
},
|
|
2096
2096
|
_doFinalize: function() {
|
|
2097
|
-
var ge = this._data,
|
|
2098
|
-
return
|
|
2097
|
+
var ge = this._data, G = ge.words, I = this._nDataBytes * 8, ee = ge.sigBytes * 8;
|
|
2098
|
+
return G[ee >>> 5] |= 128 << 24 - ee % 32, G[(ee + 64 >>> 9 << 4) + 14] = b.floor(I / 4294967296), G[(ee + 64 >>> 9 << 4) + 15] = I, ge.sigBytes = G.length * 4, this._process(), this._hash;
|
|
2099
2099
|
},
|
|
2100
2100
|
clone: function() {
|
|
2101
2101
|
var ge = H.clone.call(this);
|
|
@@ -2130,9 +2130,9 @@ function Kr() {
|
|
|
2130
2130
|
he = this._hasher = new he.init(), typeof be == "string" && (be = H.parse(be));
|
|
2131
2131
|
var Ee = he.blockSize, Le = Ee * 4;
|
|
2132
2132
|
be.sigBytes > Le && (be = he.finalize(be)), be.clamp();
|
|
2133
|
-
for (var ge = this._oKey = be.clone(),
|
|
2133
|
+
for (var ge = this._oKey = be.clone(), G = this._iKey = be.clone(), I = ge.words, ee = G.words, Ae = 0; Ae < Ee; Ae++)
|
|
2134
2134
|
I[Ae] ^= 1549556828, ee[Ae] ^= 909522486;
|
|
2135
|
-
ge.sigBytes =
|
|
2135
|
+
ge.sigBytes = G.sigBytes = Le, this.reset();
|
|
2136
2136
|
},
|
|
2137
2137
|
/**
|
|
2138
2138
|
* Resets this HMAC to its initial state.
|
|
@@ -2219,7 +2219,7 @@ var ba = { exports: {} };
|
|
|
2219
2219
|
var he = we.words, be = we.sigBytes, Ee = this._map;
|
|
2220
2220
|
we.clamp();
|
|
2221
2221
|
for (var Le = [], ge = 0; ge < be; ge += 3)
|
|
2222
|
-
for (var
|
|
2222
|
+
for (var G = he[ge >>> 2] >>> 24 - ge % 4 * 8 & 255, I = he[ge + 1 >>> 2] >>> 24 - (ge + 1) % 4 * 8 & 255, ee = he[ge + 2 >>> 2] >>> 24 - (ge + 2) % 4 * 8 & 255, Ae = G << 16 | I << 8 | ee, T = 0; T < 4 && ge + T * 0.75 < be; T++)
|
|
2223
2223
|
Le.push(Ee.charAt(Ae >>> 6 * (3 - T) & 63));
|
|
2224
2224
|
var K = Ee.charAt(64);
|
|
2225
2225
|
if (K)
|
|
@@ -2249,8 +2249,8 @@ var ba = { exports: {} };
|
|
|
2249
2249
|
}
|
|
2250
2250
|
var ge = be.charAt(64);
|
|
2251
2251
|
if (ge) {
|
|
2252
|
-
var
|
|
2253
|
-
|
|
2252
|
+
var G = we.indexOf(ge);
|
|
2253
|
+
G !== -1 && (he = G);
|
|
2254
2254
|
}
|
|
2255
2255
|
return H(we, he, Ee);
|
|
2256
2256
|
},
|
|
@@ -2259,7 +2259,7 @@ var ba = { exports: {} };
|
|
|
2259
2259
|
function H(we, he, be) {
|
|
2260
2260
|
for (var Ee = [], Le = 0, ge = 0; ge < he; ge++)
|
|
2261
2261
|
if (ge % 4) {
|
|
2262
|
-
var
|
|
2262
|
+
var G = be[we.charCodeAt(ge - 1)] << ge % 4 * 2, I = be[we.charCodeAt(ge)] >>> 6 - ge % 4 * 2, ee = G | I;
|
|
2263
2263
|
Ee[Le >>> 2] |= ee << 24 - Le % 4 * 8, Le++;
|
|
2264
2264
|
}
|
|
2265
2265
|
return F.create(Ee, Le);
|
|
@@ -2355,9 +2355,9 @@ var ya = { exports: {} };
|
|
|
2355
2355
|
return typeof e == "number";
|
|
2356
2356
|
}, F = function(e) {
|
|
2357
2357
|
return new M(e);
|
|
2358
|
-
}, _e = F.LM = "2023-12-24 18:09", H = "https://github.com/xiangyuecn/Recorder", we = "Recorder", he = "getUserMedia", be = "srcSampleRate", Ee = "sampleRate", Le = "bitRate", ge = "catch",
|
|
2359
|
-
if (
|
|
2360
|
-
|
|
2358
|
+
}, _e = F.LM = "2023-12-24 18:09", H = "https://github.com/xiangyuecn/Recorder", we = "Recorder", he = "getUserMedia", be = "srcSampleRate", Ee = "sampleRate", Le = "bitRate", ge = "catch", G = Q[we];
|
|
2359
|
+
if (G && G.LM == _e) {
|
|
2360
|
+
G.CLog(G.i18n.$T("K8zP::重复导入{1}", 0, we), 3);
|
|
2361
2361
|
return;
|
|
2362
2362
|
}
|
|
2363
2363
|
F.IsOpen = function() {
|
|
@@ -2425,33 +2425,33 @@ var ya = { exports: {} };
|
|
|
2425
2425
|
var K = function(e, s) {
|
|
2426
2426
|
var d = e.BufferSize || F.BufferSize, h = e.Stream, C = h._RC || h._c || F.GetContext(!0);
|
|
2427
2427
|
h._c = C;
|
|
2428
|
-
var W = function(
|
|
2428
|
+
var W = function(j) {
|
|
2429
2429
|
var y = h._m = C.createMediaStreamSource(h), ye = C.destination, m = "createMediaStreamDestination";
|
|
2430
|
-
C[m] && (ye = h._d = C[m]()), y.connect(
|
|
2431
|
-
}, x, i, ie, de = "", ke = h._call, Oe = function(
|
|
2430
|
+
C[m] && (ye = h._d = C[m]()), y.connect(j), j.connect(ye);
|
|
2431
|
+
}, x, i, ie, de = "", ke = h._call, Oe = function(j) {
|
|
2432
2432
|
for (var y in ke) {
|
|
2433
|
-
for (var ye =
|
|
2434
|
-
var N = Math.max(-1, Math.min(1,
|
|
2433
|
+
for (var ye = j.length, m = new Int16Array(ye), P = 0, fe = 0; fe < ye; fe++) {
|
|
2434
|
+
var N = Math.max(-1, Math.min(1, j[fe]));
|
|
2435
2435
|
N = N < 0 ? N * 32768 : N * 32767, m[fe] = N, P += Math.abs(N);
|
|
2436
2436
|
}
|
|
2437
2437
|
for (var ue in ke)
|
|
2438
2438
|
ke[ue](m, P);
|
|
2439
2439
|
return;
|
|
2440
2440
|
}
|
|
2441
|
-
}, pe = "ScriptProcessor",
|
|
2441
|
+
}, pe = "ScriptProcessor", z = "audioWorklet", me = we + " " + z, oe = "RecProc", X = "MediaRecorder", Se = X + ".WebM.PCM", Fe = C.createScriptProcessor || C.createJavaScriptNode, V = He("ZGlf::。由于{1}内部1秒375次回调,在移动端可能会有性能问题导致回调丢失录音变短,PC端无影响,暂不建议开启{1}。", 0, z), se = function() {
|
|
2442
2442
|
i = h.isWorklet = !1, re(h), Pe(He("7TU0::Connect采用老的{1},", 0, pe) + Xe.get(
|
|
2443
2443
|
F[T] ? He("JwCL::但已设置{1}尝试启用{2}", 2) : He("VGjB::可设置{1}尝试启用{2}", 2),
|
|
2444
|
-
[we + "." + T + "=true",
|
|
2444
|
+
[we + "." + T + "=true", z]
|
|
2445
2445
|
) + de + V, 3);
|
|
2446
|
-
var
|
|
2447
|
-
W(
|
|
2446
|
+
var j = h._p = Fe.call(C, d, 1, 1);
|
|
2447
|
+
W(j), j.onaudioprocess = function(y) {
|
|
2448
2448
|
var ye = y.inputBuffer.getChannelData(0);
|
|
2449
2449
|
Oe(ye);
|
|
2450
2450
|
};
|
|
2451
2451
|
}, o = function() {
|
|
2452
2452
|
x = h.isWebM = !1, te(h), i = h.isWorklet = !Fe || F[T];
|
|
2453
|
-
var
|
|
2454
|
-
if (!(i && C[
|
|
2453
|
+
var j = window.AudioWorkletNode;
|
|
2454
|
+
if (!(i && C[z] && j)) {
|
|
2455
2455
|
se();
|
|
2456
2456
|
return;
|
|
2457
2457
|
}
|
|
@@ -2472,8 +2472,8 @@ var ya = { exports: {} };
|
|
|
2472
2472
|
var R = ~~(l / Y) * Y;
|
|
2473
2473
|
if (R) {
|
|
2474
2474
|
this.port.postMessage({ val: t.slice(0, R) });
|
|
2475
|
-
var
|
|
2476
|
-
t = new Float32Array(Y * 2), t.set(
|
|
2475
|
+
var q = t.subarray(R, l);
|
|
2476
|
+
t = new Float32Array(Y * 2), t.set(q), l = q.length, L.buffer = t;
|
|
2477
2477
|
}
|
|
2478
2478
|
L.pos = l;
|
|
2479
2479
|
}
|
|
@@ -2483,16 +2483,16 @@ var ya = { exports: {} };
|
|
|
2483
2483
|
return i && h._na;
|
|
2484
2484
|
}, m = h._na = function() {
|
|
2485
2485
|
ie !== "" && (clearTimeout(ie), ie = setTimeout(function() {
|
|
2486
|
-
ie = 0, ye() && (Pe(He("MxX1::{1}未返回任何音频,恢复使用{2}", 0,
|
|
2486
|
+
ie = 0, ye() && (Pe(He("MxX1::{1}未返回任何音频,恢复使用{2}", 0, z, pe), 3), Fe && se());
|
|
2487
2487
|
}, 500));
|
|
2488
2488
|
}, P = function() {
|
|
2489
2489
|
if (ye()) {
|
|
2490
|
-
var fe = h._n = new
|
|
2490
|
+
var fe = h._n = new j(C, oe, {
|
|
2491
2491
|
processorOptions: { bufferSize: d }
|
|
2492
2492
|
});
|
|
2493
2493
|
W(fe), fe.port.onmessage = function(N) {
|
|
2494
|
-
ie && (clearTimeout(ie), ie = ""), ye() ? Oe(N.data.val) : i || Pe(He("XUap::{1}多余回调", 0,
|
|
2495
|
-
}, Pe(He("yOta::Connect采用{1},设置{2}可恢复老式{3}", 0,
|
|
2494
|
+
ie && (clearTimeout(ie), ie = ""), ye() ? Oe(N.data.val) : i || Pe(He("XUap::{1}多余回调", 0, z), 3);
|
|
2495
|
+
}, Pe(He("yOta::Connect采用{1},设置{2}可恢复老式{3}", 0, z, we + "." + T + "=false", pe) + de + V, 3);
|
|
2496
2496
|
}
|
|
2497
2497
|
};
|
|
2498
2498
|
C.resume()[ke && "finally"](function() {
|
|
@@ -2502,17 +2502,17 @@ var ya = { exports: {} };
|
|
|
2502
2502
|
return;
|
|
2503
2503
|
}
|
|
2504
2504
|
var fe = y();
|
|
2505
|
-
C[
|
|
2505
|
+
C[z].addModule(fe).then(function(N) {
|
|
2506
2506
|
ye() && (C[oe] = 1, P(), ie && m());
|
|
2507
2507
|
})[ge](function(N) {
|
|
2508
|
-
Pe(
|
|
2508
|
+
Pe(z + ".addModule Error", 1, N), ye() && se();
|
|
2509
2509
|
});
|
|
2510
2510
|
}
|
|
2511
2511
|
});
|
|
2512
2512
|
}, A = function() {
|
|
2513
|
-
var
|
|
2513
|
+
var j = window[X], y = "ondataavailable", ye = "audio/webm; codecs=pcm";
|
|
2514
2514
|
x = h.isWebM = F[Ae];
|
|
2515
|
-
var m =
|
|
2515
|
+
var m = j && y in j.prototype && j.isTypeSupported(ye);
|
|
2516
2516
|
if (de = m ? "" : He("VwPd::(此浏览器不支持{1})", 0, Se), !s || !x || !m) {
|
|
2517
2517
|
o();
|
|
2518
2518
|
return;
|
|
@@ -2522,10 +2522,10 @@ var ya = { exports: {} };
|
|
|
2522
2522
|
};
|
|
2523
2523
|
h._ra = function() {
|
|
2524
2524
|
ie !== "" && (clearTimeout(ie), ie = setTimeout(function() {
|
|
2525
|
-
P() && (Pe(He("vHnb::{1}未返回任何音频,降级使用{2}", 0, X,
|
|
2525
|
+
P() && (Pe(He("vHnb::{1}未返回任何音频,降级使用{2}", 0, X, z), 3), o());
|
|
2526
2526
|
}, 500));
|
|
2527
2527
|
};
|
|
2528
|
-
var fe = Object.assign({ mimeType: ye }, F.ConnectWebMOptions), N = h._r = new
|
|
2528
|
+
var fe = Object.assign({ mimeType: ye }, F.ConnectWebMOptions), N = h._r = new j(h, fe), ue = h._rd = { sampleRate: C[Ee] };
|
|
2529
2529
|
N[y] = function(O) {
|
|
2530
2530
|
var Te = new FileReader();
|
|
2531
2531
|
Te.onloadend = function() {
|
|
@@ -2541,7 +2541,7 @@ var ya = { exports: {} };
|
|
|
2541
2541
|
} else
|
|
2542
2542
|
x || Pe(He("O9P7::{1}多余回调", 0, X), 3);
|
|
2543
2543
|
}, Te.readAsArrayBuffer(O.data);
|
|
2544
|
-
}, N.start(~~(d / 48)), Pe(He("LMEm::Connect采用{1},设置{2}可恢复使用{3}或老式{4}", 0, Se, we + "." + Ae + "=false",
|
|
2544
|
+
}, N.start(~~(d / 48)), Pe(He("LMEm::Connect采用{1},设置{2}可恢复使用{3}或老式{4}", 0, Se, we + "." + Ae + "=false", z, pe));
|
|
2545
2545
|
};
|
|
2546
2546
|
A();
|
|
2547
2547
|
}, ve = function(e) {
|
|
@@ -2574,24 +2574,24 @@ var ya = { exports: {} };
|
|
|
2574
2574
|
C || (C = {});
|
|
2575
2575
|
var pe = C.frameSize || 1;
|
|
2576
2576
|
C.frameType && (pe = C.frameType == "mp3" ? 1152 : 1);
|
|
2577
|
-
var
|
|
2578
|
-
x >
|
|
2579
|
-
for (var me = 0, oe = x; oe <
|
|
2577
|
+
var z = e.length;
|
|
2578
|
+
x > z + 1 && Pe(He("tlbC::{1}似乎传入了未重置chunk {2}", 0, W, x + ">" + z), 3);
|
|
2579
|
+
for (var me = 0, oe = x; oe < z; oe++)
|
|
2580
2580
|
me += e[oe].length;
|
|
2581
2581
|
me = Math.max(0, me - Math.floor(i));
|
|
2582
2582
|
var X = s / d;
|
|
2583
2583
|
X > 1 ? me = Math.floor(me / X) : (X = 1, d = s), me += Oe.length;
|
|
2584
2584
|
for (var Se = new Int16Array(me), Fe = 0, oe = 0; oe < Oe.length; oe++)
|
|
2585
2585
|
Se[Fe] = Oe[oe], Fe++;
|
|
2586
|
-
for (; x <
|
|
2587
|
-
for (var V = e[x], oe = i, se = V.length, o = ke && ke.Embed, A = 0,
|
|
2588
|
-
if (P < se && (o ? (y = V[P], ye = o.b0 * y + o.b1 * o.x1 + o.b0 * o.x2 - o.a1 * o.y1 - o.a2 * o.y2, o.x2 = o.x1, o.x1 = y, o.y2 = o.y1, o.y1 = ye) : ye = ke ? ke(V[P]) : V[P]), A =
|
|
2586
|
+
for (; x < z; x++) {
|
|
2587
|
+
for (var V = e[x], oe = i, se = V.length, o = ke && ke.Embed, A = 0, j = 0, y = 0, ye = 0, m = 0, P = 0; m < se; m++, P++) {
|
|
2588
|
+
if (P < se && (o ? (y = V[P], ye = o.b0 * y + o.b1 * o.x1 + o.b0 * o.x2 - o.a1 * o.y1 - o.a2 * o.y2, o.x2 = o.x1, o.x1 = y, o.y2 = o.y1, o.y1 = ye) : ye = ke ? ke(V[P]) : V[P]), A = j, j = ye, P == 0) {
|
|
2589
2589
|
m--;
|
|
2590
2590
|
continue;
|
|
2591
2591
|
}
|
|
2592
2592
|
var fe = Math.floor(oe);
|
|
2593
2593
|
if (m == fe) {
|
|
2594
|
-
var N = Math.ceil(oe), ue = oe - fe, O = A, Te = N < se ?
|
|
2594
|
+
var N = Math.ceil(oe), ue = oe - fe, O = A, Te = N < se ? j : O, L = O + (Te - O) * ue;
|
|
2595
2595
|
L > 32767 ? L = 32767 : L < -32768 && (L = -32768), Se[Fe] = L, Fe++, oe += X;
|
|
2596
2596
|
}
|
|
2597
2597
|
}
|
|
@@ -2617,8 +2617,8 @@ var ya = { exports: {} };
|
|
|
2617
2617
|
var ke = (1 - W) / 2 / i, Oe = (1 - W) / i;
|
|
2618
2618
|
else
|
|
2619
2619
|
var ke = (1 + W) / 2 / i, Oe = -(1 + W) / i;
|
|
2620
|
-
var pe = 0,
|
|
2621
|
-
return me = ke * Fe + Oe * pe + ke *
|
|
2620
|
+
var pe = 0, z = 0, me = 0, oe = 0, X = 0, Se = function(Fe) {
|
|
2621
|
+
return me = ke * Fe + Oe * pe + ke * z - ie * oe - de * X, z = pe, pe = Fe, X = oe, oe = me, me;
|
|
2622
2622
|
};
|
|
2623
2623
|
return Se.Embed = { x1: 0, x2: 0, y1: 0, y2: 0, b0: ke, b1: Oe, a1: ie, a2: de }, Se;
|
|
2624
2624
|
}, F.PowerLevel = function(e, s) {
|
|
@@ -2720,8 +2720,8 @@ var ya = { exports: {} };
|
|
|
2720
2720
|
return;
|
|
2721
2721
|
}
|
|
2722
2722
|
Ce(C);
|
|
2723
|
-
var
|
|
2724
|
-
|
|
2723
|
+
var z = d.Stream = h.sourceStream;
|
|
2724
|
+
z._RC = h.runningContext, z._call = {};
|
|
2725
2725
|
try {
|
|
2726
2726
|
K(C);
|
|
2727
2727
|
} catch (o) {
|
|
@@ -2814,10 +2814,10 @@ var ya = { exports: {} };
|
|
|
2814
2814
|
}
|
|
2815
2815
|
var W = d[be], x = e.length, i = F.PowerLevel(s, x), ie = d.buffers, de = ie.length;
|
|
2816
2816
|
ie.push(e);
|
|
2817
|
-
var ke = ie, Oe = de, pe = Date.now(),
|
|
2818
|
-
d.envInLast = pe, d.buffers.length == 1 && (d.envInFirst = pe -
|
|
2817
|
+
var ke = ie, Oe = de, pe = Date.now(), z = Math.round(x / W * 1e3);
|
|
2818
|
+
d.envInLast = pe, d.buffers.length == 1 && (d.envInFirst = pe - z);
|
|
2819
2819
|
var me = d.envInFixTs;
|
|
2820
|
-
me.splice(0, 0, { t: pe, d:
|
|
2820
|
+
me.splice(0, 0, { t: pe, d: z });
|
|
2821
2821
|
for (var oe = pe, X = 0, Se = 0; Se < me.length; Se++) {
|
|
2822
2822
|
var Fe = me[Se];
|
|
2823
2823
|
if (pe - Fe.t > 3e3) {
|
|
@@ -2828,10 +2828,10 @@ var ya = { exports: {} };
|
|
|
2828
2828
|
}
|
|
2829
2829
|
var V = me[1], se = pe - oe, o = se - X;
|
|
2830
2830
|
if (o > se / 3 && (V && se > 1e3 || me.length >= 6)) {
|
|
2831
|
-
var A = pe - V.t -
|
|
2832
|
-
if (A >
|
|
2833
|
-
var
|
|
2834
|
-
if (d.CLog("[" + pe + "]" + Xe.get(He(
|
|
2831
|
+
var A = pe - V.t - z;
|
|
2832
|
+
if (A > z / 5) {
|
|
2833
|
+
var j = !h.disableEnvInFix;
|
|
2834
|
+
if (d.CLog("[" + pe + "]" + Xe.get(He(j ? "4Kfd::补偿{1}ms" : "bM5i::未补偿{1}ms", 1), [A]), 3), d.envInFix += A, j) {
|
|
2835
2835
|
var y = new Int16Array(A * W / 1e3);
|
|
2836
2836
|
x += y.length, ie.push(y);
|
|
2837
2837
|
}
|
|
@@ -2843,16 +2843,16 @@ var ya = { exports: {} };
|
|
|
2843
2843
|
C.chunkInfo = fe, ye = C.pcmSize, m = fe.data.length, P = ye + m, C.pcmSize = P, ie = C.pcmDatas, de = ie.length, ie.push(fe.data), W = fe[Ee];
|
|
2844
2844
|
}
|
|
2845
2845
|
var N = Math.round(P / W * 1e3), ue = ie.length, O = ke.length, Te = function() {
|
|
2846
|
-
for (var R = L ? 0 : -m,
|
|
2846
|
+
for (var R = L ? 0 : -m, q = ie[0] == null, g = de; g < ue; g++) {
|
|
2847
2847
|
var f = ie[g];
|
|
2848
|
-
f == null ?
|
|
2848
|
+
f == null ? q = 1 : (R += f.length, C && f.length && d[h.type + "_encode"](C, f));
|
|
2849
2849
|
}
|
|
2850
|
-
if (
|
|
2850
|
+
if (q && C) {
|
|
2851
2851
|
var g = Oe;
|
|
2852
2852
|
for (ke[0] && (g = 0); g < O; g++)
|
|
2853
2853
|
ke[g] = null;
|
|
2854
2854
|
}
|
|
2855
|
-
|
|
2855
|
+
q && (R = L ? m : 0, ie[0] = null), C ? C.pcmSize += R : d.recSize += R;
|
|
2856
2856
|
}, L = 0, Y = "rec.set.onProcess";
|
|
2857
2857
|
try {
|
|
2858
2858
|
L = h.onProcess(ie, i, N, W, de, Te);
|
|
@@ -2914,7 +2914,7 @@ var ya = { exports: {} };
|
|
|
2914
2914
|
}, de = function(Fe) {
|
|
2915
2915
|
h.CLog(He("u8JG::结束录音失败:") + Fe, 1), s && s(Fe), ie();
|
|
2916
2916
|
}, ke = function(Fe, V, se) {
|
|
2917
|
-
var o = "blob", A = "arraybuffer",
|
|
2917
|
+
var o = "blob", A = "arraybuffer", j = "dataType", y = "DefaultDataType", ye = h[j] || F[y] || o, m = j + "=" + ye, P = Fe instanceof ArrayBuffer, fe = 0, N = P ? Fe.byteLength : Fe.size;
|
|
2918
2918
|
if (ye == A ? P || (fe = 1) : ye == o ? typeof Blob != "function" ? fe = He.G("NonBrowser-1", [m]) + He("1skY::,请设置{1}", 0, we + "." + y + '="' + A + '"') : (P && (Fe = new Blob([Fe], { type: V })), Fe instanceof Blob || (fe = 1), V = Fe.type || V) : fe = He.G("NotSupport-1", [m]), h.CLog(He("Wv7l::结束录音 编码花{1}ms 音频时长{2}ms 文件大小{3}b", 0, Date.now() - W, se, N) + " " + m + "," + V), fe) {
|
|
2919
2919
|
de(fe != 1 ? fe : He("Vkbd::{1}编码器返回的不是{2}", 0, C.type, ye) + ", " + m);
|
|
2920
2920
|
return;
|
|
@@ -2945,9 +2945,9 @@ var ya = { exports: {} };
|
|
|
2945
2945
|
return;
|
|
2946
2946
|
}
|
|
2947
2947
|
if (h.isMock) {
|
|
2948
|
-
var
|
|
2949
|
-
if (
|
|
2950
|
-
de(He("AxOH::录音错误:") +
|
|
2948
|
+
var z = h.envCheck(h.mockEnvInfo || { envName: "mock", canProcess: !1 });
|
|
2949
|
+
if (z) {
|
|
2950
|
+
de(He("AxOH::录音错误:") + z);
|
|
2951
2951
|
return;
|
|
2952
2952
|
}
|
|
2953
2953
|
}
|
|
@@ -2989,10 +2989,10 @@ var ya = { exports: {} };
|
|
|
2989
2989
|
return;
|
|
2990
2990
|
if (Ve(i, [22, 84, 174, 107])) {
|
|
2991
2991
|
for (; de[0] < ie.length; ) {
|
|
2992
|
-
var Oe = Ye(ie, de), pe = tt(ie, de),
|
|
2992
|
+
var Oe = Ye(ie, de), pe = tt(ie, de), z = [0], me = { channels: 0, sampleRate: 0 };
|
|
2993
2993
|
if (Ve(Oe, [174]))
|
|
2994
|
-
for (;
|
|
2995
|
-
var oe = Ye(pe,
|
|
2994
|
+
for (; z[0] < pe.length; ) {
|
|
2995
|
+
var oe = Ye(pe, z), X = tt(pe, z), Se = [0];
|
|
2996
2996
|
if (Ve(oe, [215])) {
|
|
2997
2997
|
var Fe = Me(X);
|
|
2998
2998
|
me.number = Fe, d[Fe] = me;
|
|
@@ -3007,8 +3007,8 @@ var ya = { exports: {} };
|
|
|
3007
3007
|
for (; Se[0] < X.length; ) {
|
|
3008
3008
|
var o = Ye(X, Se), A = tt(X, Se);
|
|
3009
3009
|
if (Ve(o, [181])) {
|
|
3010
|
-
var Fe = 0,
|
|
3011
|
-
A.length == 4 ? Fe = new Float32Array(
|
|
3010
|
+
var Fe = 0, j = new Uint8Array(A.reverse()).buffer;
|
|
3011
|
+
A.length == 4 ? Fe = new Float32Array(j)[0] : A.length == 8 ? Fe = new Float64Array(j)[0] : Pe("WebM Track !Float", 1, A), me[Ee] = Math.round(Fe);
|
|
3012
3012
|
} else
|
|
3013
3013
|
Ve(o, [98, 100]) ? me.bitDepth = Me(A) : Ve(o, [159]) && (me.channels = Me(A));
|
|
3014
3014
|
}
|
|
@@ -3044,13 +3044,13 @@ var ya = { exports: {} };
|
|
|
3044
3044
|
N.set(x.subarray(s.pos[0])), s.bytes = N, s.pos[0] = 0;
|
|
3045
3045
|
for (var fe = new Uint8Array(m), se = 0, ue = 0; se < ye.length; se++)
|
|
3046
3046
|
fe.set(ye[se], ue), ue += ye[se].length;
|
|
3047
|
-
var
|
|
3047
|
+
var j = new Float32Array(fe.buffer);
|
|
3048
3048
|
if (y.channels > 1) {
|
|
3049
|
-
for (var O = [], se = 0; se <
|
|
3050
|
-
O.push(
|
|
3051
|
-
|
|
3049
|
+
for (var O = [], se = 0; se < j.length; )
|
|
3050
|
+
O.push(j[se]), se += y.channels;
|
|
3051
|
+
j = new Float32Array(O);
|
|
3052
3052
|
}
|
|
3053
|
-
return
|
|
3053
|
+
return j;
|
|
3054
3054
|
}
|
|
3055
3055
|
}
|
|
3056
3056
|
}, Ve = function(e, s) {
|
|
@@ -3174,7 +3174,7 @@ var ya = { exports: {} };
|
|
|
3174
3174
|
}
|
|
3175
3175
|
}
|
|
3176
3176
|
};
|
|
3177
|
-
|
|
3177
|
+
G && (Pe(He("8HO5::覆盖导入{1}", 0, we), 1), G.Destroy()), Q[we] = F;
|
|
3178
3178
|
});
|
|
3179
3179
|
})(ya);
|
|
3180
3180
|
var on = ya.exports;
|
|
@@ -3191,20 +3191,20 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3191
3191
|
return ae("Zm7L::采样率范围:{1};比特率范围:{2}(不同比特率支持的采样率范围不同,小于32kbps时采样率需小于32000)", 0, le, F);
|
|
3192
3192
|
}
|
|
3193
3193
|
};
|
|
3194
|
-
var _e = function(
|
|
3195
|
-
var I =
|
|
3194
|
+
var _e = function(G) {
|
|
3195
|
+
var I = G.bitRate, ee = G.sampleRate, Ae = ee;
|
|
3196
3196
|
if ((" " + F + ",").indexOf(" " + I + ",") == -1 && w.CLog(ae("eGB9::{1}不在mp3支持的取值范围:{2}", 0, "bitRate=" + I, F), 3), (" " + le + ",").indexOf(" " + ee + ",") == -1) {
|
|
3197
3197
|
for (var T = le.split(", "), K = [], ve = 0; ve < T.length; ve++)
|
|
3198
3198
|
K.push({ v: +T[ve], s: Math.abs(T[ve] - ee) });
|
|
3199
3199
|
K.sort(function(re, te) {
|
|
3200
3200
|
return re.s - te.s;
|
|
3201
|
-
}), Ae = K[0].v,
|
|
3201
|
+
}), Ae = K[0].v, G.sampleRate = Ae, w.CLog(ae("zLTa::sampleRate已更新为{1},因为{2}不在mp3支持的取值范围:{3}", 0, Ae, ee, le), 3);
|
|
3202
3202
|
}
|
|
3203
3203
|
}, H = function() {
|
|
3204
3204
|
return ae.G("NeedImport-2", ["mp3.js", "src/engine/mp3-engine.js"]);
|
|
3205
3205
|
}, we = b && typeof Worker == "function";
|
|
3206
|
-
w.prototype.mp3 = function(
|
|
3207
|
-
var Ae = this, T = Ae.set, K =
|
|
3206
|
+
w.prototype.mp3 = function(G, I, ee) {
|
|
3207
|
+
var Ae = this, T = Ae.set, K = G.length;
|
|
3208
3208
|
if (!w.lamejs) {
|
|
3209
3209
|
ee(H());
|
|
3210
3210
|
return;
|
|
@@ -3213,7 +3213,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3213
3213
|
var ve = Ae.mp3_start(T);
|
|
3214
3214
|
if (ve) {
|
|
3215
3215
|
if (ve.isW) {
|
|
3216
|
-
Ae.mp3_encode(ve,
|
|
3216
|
+
Ae.mp3_encode(ve, G), Ae.mp3_complete(ve, I, ee, 1);
|
|
3217
3217
|
return;
|
|
3218
3218
|
}
|
|
3219
3219
|
Ae.mp3_stop(ve);
|
|
@@ -3223,7 +3223,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3223
3223
|
var re = new w.lamejs.Mp3Encoder(1, T.sampleRate, T.bitRate), te = 57600, Ce = new Int8Array(5e5), Ue = 0, Pe = 0, Je = function() {
|
|
3224
3224
|
try {
|
|
3225
3225
|
if (Pe < K)
|
|
3226
|
-
var Ie = re.encodeBuffer(
|
|
3226
|
+
var Ie = re.encodeBuffer(G.subarray(Pe, Pe + te));
|
|
3227
3227
|
else
|
|
3228
3228
|
var Ie = re.flush();
|
|
3229
3229
|
} catch (Ye) {
|
|
@@ -3250,13 +3250,13 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3250
3250
|
var he;
|
|
3251
3251
|
w.BindDestroy("mp3Worker", function() {
|
|
3252
3252
|
he && (w.CLog("mp3Worker Destroy"), he.terminate(), he = null);
|
|
3253
|
-
}), w.prototype.mp3_envCheck = function(
|
|
3253
|
+
}), w.prototype.mp3_envCheck = function(G, I) {
|
|
3254
3254
|
var ee = "";
|
|
3255
3255
|
return I.takeoffEncodeChunk && (Ee() || (ee = ae("yhUs::当前浏览器版本太低,无法实时处理"))), !ee && !w.lamejs && (ee = H()), ee;
|
|
3256
|
-
}, w.prototype.mp3_start = function(
|
|
3257
|
-
return Ee(
|
|
3256
|
+
}, w.prototype.mp3_start = function(G) {
|
|
3257
|
+
return Ee(G);
|
|
3258
3258
|
};
|
|
3259
|
-
var be = { id: 0 }, Ee = function(
|
|
3259
|
+
var be = { id: 0 }, Ee = function(G, I) {
|
|
3260
3260
|
var ee = function(Je) {
|
|
3261
3261
|
var Ie = Je.data, M = K.wkScope.wk_ctxs, Be = K.wkScope.wk_lame, Ve = K.wkScope.wk_mp3TrimFix, Me = M[Ie.id];
|
|
3262
3262
|
if (Ie.action == "init")
|
|
@@ -3323,13 +3323,13 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3323
3323
|
Be && (M.action == "takeoff" ? Be.set.takeoffEncodeChunk(new Uint8Array(M.chunk.buffer)) : (Be.call && Be.call(M), Be.call = null));
|
|
3324
3324
|
};
|
|
3325
3325
|
}, T = function() {
|
|
3326
|
-
var Je = { worker: ve, set:
|
|
3327
|
-
return
|
|
3326
|
+
var Je = { worker: ve, set: G };
|
|
3327
|
+
return G ? (Je.id = ++be.id, be[Je.id] = Je, _e(G), ve.postMessage({
|
|
3328
3328
|
action: "init",
|
|
3329
3329
|
id: Je.id,
|
|
3330
|
-
sampleRate:
|
|
3331
|
-
bitRate:
|
|
3332
|
-
takeoff: !!
|
|
3330
|
+
sampleRate: G.sampleRate,
|
|
3331
|
+
bitRate: G.bitRate,
|
|
3332
|
+
takeoff: !!G.takeoffEncodeChunk,
|
|
3333
3333
|
x: new Int16Array(5)
|
|
3334
3334
|
//低版本浏览器不支持序列化TypedArray
|
|
3335
3335
|
})) : ve.postMessage({
|
|
@@ -3359,36 +3359,36 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3359
3359
|
var Pe = T();
|
|
3360
3360
|
return Pe.isW = 1, he = ve, Pe;
|
|
3361
3361
|
} catch (Je) {
|
|
3362
|
-
return ve && ve.terminate(), console.error(Je), Ee(
|
|
3362
|
+
return ve && ve.terminate(), console.error(Je), Ee(G, 1);
|
|
3363
3363
|
}
|
|
3364
3364
|
};
|
|
3365
|
-
w.prototype.mp3_stop = function(
|
|
3366
|
-
if (
|
|
3367
|
-
|
|
3365
|
+
w.prototype.mp3_stop = function(G) {
|
|
3366
|
+
if (G && G.worker) {
|
|
3367
|
+
G.worker.postMessage({
|
|
3368
3368
|
action: "stop",
|
|
3369
|
-
id:
|
|
3370
|
-
}),
|
|
3369
|
+
id: G.id
|
|
3370
|
+
}), G.worker = null, delete be[G.id];
|
|
3371
3371
|
var I = -1;
|
|
3372
3372
|
for (var ee in be)
|
|
3373
3373
|
I++;
|
|
3374
3374
|
I && w.CLog(ae("fT6M::mp3 worker剩{1}个未stop", 0, I), 3);
|
|
3375
3375
|
}
|
|
3376
|
-
}, w.prototype.mp3_encode = function(
|
|
3377
|
-
|
|
3376
|
+
}, w.prototype.mp3_encode = function(G, I) {
|
|
3377
|
+
G && G.worker && G.worker.postMessage({
|
|
3378
3378
|
action: "encode",
|
|
3379
|
-
id:
|
|
3379
|
+
id: G.id,
|
|
3380
3380
|
pcm: I
|
|
3381
3381
|
});
|
|
3382
|
-
}, w.prototype.mp3_complete = function(
|
|
3382
|
+
}, w.prototype.mp3_complete = function(G, I, ee, Ae) {
|
|
3383
3383
|
var T = this;
|
|
3384
|
-
|
|
3385
|
-
Ae && T.mp3_stop(
|
|
3386
|
-
},
|
|
3384
|
+
G && G.worker ? (G.call = function(K) {
|
|
3385
|
+
Ae && T.mp3_stop(G), K.err ? ee(K.err) : (ge(K.meta, G.set), I(K.blob, "audio/mp3"));
|
|
3386
|
+
}, G.worker.postMessage({
|
|
3387
3387
|
action: "complete",
|
|
3388
|
-
id:
|
|
3388
|
+
id: G.id
|
|
3389
3389
|
})) : ee(ae("mPxH::mp3编码器未start"));
|
|
3390
|
-
}, w.mp3ReadMeta = function(
|
|
3391
|
-
var ee = typeof window < "u" && window.parseInt || typeof self < "u" && self.parseInt || parseInt, Ae = new Uint8Array(
|
|
3390
|
+
}, w.mp3ReadMeta = function(G, I) {
|
|
3391
|
+
var ee = typeof window < "u" && window.parseInt || typeof self < "u" && self.parseInt || parseInt, Ae = new Uint8Array(G[0] || []);
|
|
3392
3392
|
if (Ae.length < 4)
|
|
3393
3393
|
return null;
|
|
3394
3394
|
var T = function(k, e) {
|
|
@@ -3411,8 +3411,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3411
3411
|
][re == 1 ? 1 : 0][ee(ve.substr(0, 4), 2)];
|
|
3412
3412
|
if (!re || !te || !Ue || !Ce)
|
|
3413
3413
|
return null;
|
|
3414
|
-
for (var Pe = Math.round(I * 8 / Ue), Je = te == 1 ? 384 : te == 2 || re == 1 ? 1152 : 576, Ie = Je / Ce * 1e3, M = Math.floor(Je * Ue / 8 / Ce * 1e3), Be = 0, Ve = 0, Me = 0; Me <
|
|
3415
|
-
var Ye =
|
|
3414
|
+
for (var Pe = Math.round(I * 8 / Ue), Je = te == 1 ? 384 : te == 2 || re == 1 ? 1152 : 576, Ie = Je / Ce * 1e3, M = Math.floor(Je * Ue / 8 / Ce * 1e3), Be = 0, Ve = 0, Me = 0; Me < G.length; Me++) {
|
|
3415
|
+
var Ye = G[Me];
|
|
3416
3416
|
if (Ve += Ye.byteLength, Ve >= M + 3) {
|
|
3417
3417
|
var tt = new Uint8Array(Ye), Xe = Ye.byteLength - (Ve - (M + 3) + 1), He = T(Xe, tt);
|
|
3418
3418
|
Be = He.charAt(6) == "1";
|
|
@@ -3435,25 +3435,25 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3435
3435
|
var Le = {
|
|
3436
3436
|
//minfiy keep name
|
|
3437
3437
|
rm: w.mp3ReadMeta,
|
|
3438
|
-
fn: function(
|
|
3439
|
-
var T = this.rm(
|
|
3438
|
+
fn: function(G, I, ee, Ae) {
|
|
3439
|
+
var T = this.rm(G, I);
|
|
3440
3440
|
if (!T)
|
|
3441
3441
|
return { err: "mp3 unknown format" };
|
|
3442
3442
|
var K = Math.round(ee / Ae * 1e3), ve = Math.floor((T.duration - K) / T.frameDurationFloat);
|
|
3443
3443
|
if (ve > 0) {
|
|
3444
3444
|
var re = ve * T.frameSize - (T.hasPadding ? 1 : 0);
|
|
3445
3445
|
I -= re;
|
|
3446
|
-
for (var te = 0, Ce = [], Ue = 0; Ue <
|
|
3447
|
-
var Pe =
|
|
3446
|
+
for (var te = 0, Ce = [], Ue = 0; Ue < G.length; Ue++) {
|
|
3447
|
+
var Pe = G[Ue];
|
|
3448
3448
|
if (re <= 0)
|
|
3449
3449
|
break;
|
|
3450
|
-
re >= Pe.byteLength ? (re -= Pe.byteLength, Ce.push(Pe),
|
|
3450
|
+
re >= Pe.byteLength ? (re -= Pe.byteLength, Ce.push(Pe), G.splice(Ue, 1), Ue--) : (G[Ue] = Pe.slice(re), te = Pe, re = 0);
|
|
3451
3451
|
}
|
|
3452
|
-
var Je = this.rm(
|
|
3452
|
+
var Je = this.rm(G, I);
|
|
3453
3453
|
if (!Je) {
|
|
3454
|
-
te && (
|
|
3454
|
+
te && (G[0] = te);
|
|
3455
3455
|
for (var Ue = 0; Ue < Ce.length; Ue++)
|
|
3456
|
-
|
|
3456
|
+
G.splice(Ue, 0, Ce[Ue]);
|
|
3457
3457
|
T.err = "mp3 fix error: 已还原,错误原因不明";
|
|
3458
3458
|
}
|
|
3459
3459
|
var Ie = T.trimFix = {};
|
|
@@ -3461,11 +3461,11 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3461
3461
|
}
|
|
3462
3462
|
return T;
|
|
3463
3463
|
}
|
|
3464
|
-
}, ge = function(
|
|
3464
|
+
}, ge = function(G, I) {
|
|
3465
3465
|
var ee = "MP3 Info: ";
|
|
3466
|
-
(
|
|
3467
|
-
var Ae =
|
|
3468
|
-
Ae ? (ee += ae("iMSm::Fix移除{1}帧", 0, Ae.remove) + " " + Ae.removeDuration + "ms -> " + Ae.duration + "ms", Ae.remove > 2 && (
|
|
3466
|
+
(G.sampleRate && G.sampleRate != I.sampleRate || G.bitRate && G.bitRate != I.bitRate) && (w.CLog(ee + ae("uY9i::和设置的不匹配{1},已更新成{2}", 0, "set:" + I.bitRate + "kbps " + I.sampleRate + "hz", "set:" + G.bitRate + "kbps " + G.sampleRate + "hz"), 3, I), I.sampleRate = G.sampleRate, I.bitRate = G.bitRate);
|
|
3467
|
+
var Ae = G.trimFix;
|
|
3468
|
+
Ae ? (ee += ae("iMSm::Fix移除{1}帧", 0, Ae.remove) + " " + Ae.removeDuration + "ms -> " + Ae.duration + "ms", Ae.remove > 2 && (G.err = (G.err ? G.err + ", " : "") + ae("b9zm::移除帧数过多"))) : ee += (G.duration || "-") + "ms", G.err ? w.CLog(ee, 1, G.err, G) : w.CLog(ee, G);
|
|
3469
3469
|
};
|
|
3470
3470
|
});
|
|
3471
3471
|
(function(w) {
|
|
@@ -3498,50 +3498,50 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3498
3498
|
return H(o[0]);
|
|
3499
3499
|
var A = o[0];
|
|
3500
3500
|
o = o.slice(1);
|
|
3501
|
-
for (var
|
|
3502
|
-
|
|
3503
|
-
return
|
|
3501
|
+
for (var j = [], y = 0; y < A; y++)
|
|
3502
|
+
j.push(he(o));
|
|
3503
|
+
return j;
|
|
3504
3504
|
}
|
|
3505
3505
|
function be(o) {
|
|
3506
3506
|
if (o.length == 1)
|
|
3507
3507
|
return _e(o[0]);
|
|
3508
3508
|
var A = o[0];
|
|
3509
3509
|
o = o.slice(1);
|
|
3510
|
-
for (var
|
|
3511
|
-
|
|
3512
|
-
return
|
|
3510
|
+
for (var j = [], y = 0; y < A; y++)
|
|
3511
|
+
j.push(be(o));
|
|
3512
|
+
return j;
|
|
3513
3513
|
}
|
|
3514
3514
|
function Ee(o) {
|
|
3515
3515
|
if (o.length == 1)
|
|
3516
3516
|
return F(o[0]);
|
|
3517
3517
|
var A = o[0];
|
|
3518
3518
|
o = o.slice(1);
|
|
3519
|
-
for (var
|
|
3520
|
-
|
|
3521
|
-
return
|
|
3519
|
+
for (var j = [], y = 0; y < A; y++)
|
|
3520
|
+
j.push(Ee(o));
|
|
3521
|
+
return j;
|
|
3522
3522
|
}
|
|
3523
3523
|
function Le(o) {
|
|
3524
3524
|
if (o.length == 1)
|
|
3525
3525
|
return new Array(o[0]);
|
|
3526
3526
|
var A = o[0];
|
|
3527
3527
|
o = o.slice(1);
|
|
3528
|
-
for (var
|
|
3529
|
-
|
|
3530
|
-
return
|
|
3528
|
+
for (var j = [], y = 0; y < A; y++)
|
|
3529
|
+
j.push(Le(o));
|
|
3530
|
+
return j;
|
|
3531
3531
|
}
|
|
3532
3532
|
var ge = {};
|
|
3533
|
-
ge.fill = function(o, A,
|
|
3533
|
+
ge.fill = function(o, A, j, y) {
|
|
3534
3534
|
if (arguments.length == 2)
|
|
3535
3535
|
for (var ye = 0; ye < o.length; ye++)
|
|
3536
3536
|
o[ye] = arguments[1];
|
|
3537
3537
|
else
|
|
3538
|
-
for (var ye = A; ye <
|
|
3538
|
+
for (var ye = A; ye < j; ye++)
|
|
3539
3539
|
o[ye] = y;
|
|
3540
3540
|
};
|
|
3541
|
-
var
|
|
3542
|
-
|
|
3541
|
+
var G = {};
|
|
3542
|
+
G.arraycopy = function(o, A, j, y, ye) {
|
|
3543
3543
|
for (var m = A + ye; A < m; )
|
|
3544
|
-
|
|
3544
|
+
j[y++] = o[A++];
|
|
3545
3545
|
};
|
|
3546
3546
|
var I = {};
|
|
3547
3547
|
I.SQRT2 = 1.4142135623730951, I.FAST_LOG10 = function(o) {
|
|
@@ -3567,9 +3567,9 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3567
3567
|
}
|
|
3568
3568
|
K.STEREO = new K(0), K.JOINT_STEREO = new K(1), K.DUAL_CHANNEL = new K(2), K.MONO = new K(3), K.NOT_SET = new K(4);
|
|
3569
3569
|
function ve() {
|
|
3570
|
-
var o = 3, A = 98,
|
|
3570
|
+
var o = 3, A = 98, j = 4;
|
|
3571
3571
|
this.getLameShortVersion = function() {
|
|
3572
|
-
return o + "." + A + "." +
|
|
3572
|
+
return o + "." + A + "." + j;
|
|
3573
3573
|
};
|
|
3574
3574
|
}
|
|
3575
3575
|
function re() {
|
|
@@ -3580,7 +3580,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3580
3580
|
function A(c) {
|
|
3581
3581
|
this.bits = 0 | c;
|
|
3582
3582
|
}
|
|
3583
|
-
var
|
|
3583
|
+
var j = [
|
|
3584
3584
|
[0, 0],
|
|
3585
3585
|
/* 0 bands */
|
|
3586
3586
|
[0, 0],
|
|
@@ -3917,8 +3917,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3917
3917
|
}
|
|
3918
3918
|
}
|
|
3919
3919
|
};
|
|
3920
|
-
var l = [1, 1, 1, 1, 8, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16], R = [1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 2, 4, 8, 4, 8],
|
|
3921
|
-
re.slen1_tab =
|
|
3920
|
+
var l = [1, 1, 1, 1, 8, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16], R = [1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 2, 4, 8, 4, 8], q = [0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4], g = [0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3];
|
|
3921
|
+
re.slen1_tab = q, re.slen2_tab = g;
|
|
3922
3922
|
function f(c, v) {
|
|
3923
3923
|
for (var _, S = v.tt[1][c], E = v.tt[0][c], a = 0; a < M.scfsi_band.length - 1; a++) {
|
|
3924
3924
|
for (_ = M.scfsi_band[a]; _ < M.scfsi_band[a + 1] && !(E.scalefac[_] != S.scalefac[_] && S.scalefac[_] >= 0); _++)
|
|
@@ -3936,7 +3936,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
3936
3936
|
S.scalefac[_] != -1 && (Z++, D < S.scalefac[_] && (D = S.scalefac[_]));
|
|
3937
3937
|
for (var a = 0; a < 16; a++)
|
|
3938
3938
|
if (r < l[a] && D < R[a]) {
|
|
3939
|
-
var xe =
|
|
3939
|
+
var xe = q[a] * J + g[a] * Z;
|
|
3940
3940
|
S.part2_length > xe && (S.part2_length = xe, S.scalefac_compress = a);
|
|
3941
3941
|
}
|
|
3942
3942
|
}
|
|
@@ -4115,11 +4115,11 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4115
4115
|
for (var v = 2; v <= 576; v += 2) {
|
|
4116
4116
|
for (var _ = 0, S; c.scalefac_band.l[++_] < v; )
|
|
4117
4117
|
;
|
|
4118
|
-
for (S =
|
|
4118
|
+
for (S = j[_][0]; c.scalefac_band.l[S + 1] > v; )
|
|
4119
4119
|
S--;
|
|
4120
|
-
for (S < 0 && (S =
|
|
4120
|
+
for (S < 0 && (S = j[_][0]), c.bv_scf[v - 2] = S, S = j[_][1]; c.scalefac_band.l[S + c.bv_scf[v - 2] + 2] > v; )
|
|
4121
4121
|
S--;
|
|
4122
|
-
S < 0 && (S =
|
|
4122
|
+
S < 0 && (S = j[_][1]), c.bv_scf[v - 1] = S;
|
|
4123
4123
|
}
|
|
4124
4124
|
};
|
|
4125
4125
|
}
|
|
@@ -4127,14 +4127,14 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4127
4127
|
function te() {
|
|
4128
4128
|
}
|
|
4129
4129
|
function Ce() {
|
|
4130
|
-
function o(m, P, fe, N, ue, O, Te, L, Y, t, l, R,
|
|
4131
|
-
this.quant_comp = P, this.quant_comp_s = fe, this.safejoint = N, this.nsmsfix = ue, this.st_lrm = O, this.st_s = Te, this.nsbass = L, this.scale = Y, this.masking_adj = t, this.ath_lower = l, this.ath_curve = R, this.interch =
|
|
4130
|
+
function o(m, P, fe, N, ue, O, Te, L, Y, t, l, R, q, g) {
|
|
4131
|
+
this.quant_comp = P, this.quant_comp_s = fe, this.safejoint = N, this.nsmsfix = ue, this.st_lrm = O, this.st_s = Te, this.nsbass = L, this.scale = Y, this.masking_adj = t, this.ath_lower = l, this.ath_curve = R, this.interch = q, this.sfscale = g;
|
|
4132
4132
|
}
|
|
4133
4133
|
var A;
|
|
4134
4134
|
this.setModules = function(m) {
|
|
4135
4135
|
A = m;
|
|
4136
4136
|
};
|
|
4137
|
-
function
|
|
4137
|
+
function j(m, P, fe) {
|
|
4138
4138
|
b();
|
|
4139
4139
|
}
|
|
4140
4140
|
var y = [
|
|
@@ -4216,25 +4216,25 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4216
4216
|
}
|
|
4217
4217
|
switch (m.preset = P, P) {
|
|
4218
4218
|
case oe.V9:
|
|
4219
|
-
return
|
|
4219
|
+
return j(), P;
|
|
4220
4220
|
case oe.V8:
|
|
4221
|
-
return
|
|
4221
|
+
return j(), P;
|
|
4222
4222
|
case oe.V7:
|
|
4223
|
-
return
|
|
4223
|
+
return j(), P;
|
|
4224
4224
|
case oe.V6:
|
|
4225
|
-
return
|
|
4225
|
+
return j(), P;
|
|
4226
4226
|
case oe.V5:
|
|
4227
|
-
return
|
|
4227
|
+
return j(), P;
|
|
4228
4228
|
case oe.V4:
|
|
4229
|
-
return
|
|
4229
|
+
return j(), P;
|
|
4230
4230
|
case oe.V3:
|
|
4231
|
-
return
|
|
4231
|
+
return j(), P;
|
|
4232
4232
|
case oe.V2:
|
|
4233
|
-
return
|
|
4233
|
+
return j(), P;
|
|
4234
4234
|
case oe.V1:
|
|
4235
|
-
return
|
|
4235
|
+
return j(), P;
|
|
4236
4236
|
case oe.V0:
|
|
4237
|
-
return
|
|
4237
|
+
return j(), P;
|
|
4238
4238
|
}
|
|
4239
4239
|
return 8 <= P && P <= 320 ? ye(m, P, fe) : (m.preset = 0, P);
|
|
4240
4240
|
};
|
|
@@ -4243,23 +4243,23 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4243
4243
|
var o;
|
|
4244
4244
|
this.setModules = function(A) {
|
|
4245
4245
|
o = A;
|
|
4246
|
-
}, this.ResvFrameBegin = function(A,
|
|
4246
|
+
}, this.ResvFrameBegin = function(A, j) {
|
|
4247
4247
|
var y = A.internal_flags, ye, m = y.l3_side, P = o.getframebits(A);
|
|
4248
|
-
|
|
4248
|
+
j.bits = (P - y.sideinfo_len * 8) / y.mode_gr;
|
|
4249
4249
|
var fe = 8 * 256 * y.mode_gr - 8;
|
|
4250
4250
|
A.brate > 320 ? b() : (ye = 8 * 1440, A.strict_ISO && b()), y.ResvMax = ye - P, y.ResvMax > fe && (y.ResvMax = fe), (y.ResvMax < 0 || A.disable_reservoir) && (y.ResvMax = 0);
|
|
4251
|
-
var N =
|
|
4251
|
+
var N = j.bits * y.mode_gr + Math.min(y.ResvSize, y.ResvMax);
|
|
4252
4252
|
return N > ye && (N = ye), m.resvDrain_pre = 0, y.pinfo != null && b(), N;
|
|
4253
|
-
}, this.ResvMaxBits = function(A,
|
|
4253
|
+
}, this.ResvMaxBits = function(A, j, y, ye) {
|
|
4254
4254
|
var m = A.internal_flags, P, fe = m.ResvSize, N = m.ResvMax;
|
|
4255
|
-
ye != 0 && (fe +=
|
|
4255
|
+
ye != 0 && (fe += j), m.substep_shaping & 1 && (N *= 0.9), y.bits = j, fe * 10 > N * 9 ? (P = fe - N * 9 / 10, y.bits += P, m.substep_shaping |= 128) : (P = 0, m.substep_shaping &= 127, !A.disable_reservoir && !(m.substep_shaping & 1) && (y.bits -= 0.1 * j));
|
|
4256
4256
|
var ue = fe < m.ResvMax * 6 / 10 ? fe : m.ResvMax * 6 / 10;
|
|
4257
4257
|
return ue -= P, ue < 0 && (ue = 0), ue;
|
|
4258
|
-
}, this.ResvAdjust = function(A,
|
|
4259
|
-
A.ResvSize -=
|
|
4260
|
-
}, this.ResvFrameEnd = function(A,
|
|
4258
|
+
}, this.ResvAdjust = function(A, j) {
|
|
4259
|
+
A.ResvSize -= j.part2_3_length + j.part2_length;
|
|
4260
|
+
}, this.ResvFrameEnd = function(A, j) {
|
|
4261
4261
|
var y, ye = A.l3_side;
|
|
4262
|
-
A.ResvSize +=
|
|
4262
|
+
A.ResvSize += j * A.mode_gr;
|
|
4263
4263
|
var m = 0;
|
|
4264
4264
|
ye.resvDrain_post = 0, ye.resvDrain_pre = 0, (y = A.ResvSize % 8) != 0 && (m += y), y = A.ResvSize - m - A.ResvMax, y > 0 && (m += y);
|
|
4265
4265
|
{
|
|
@@ -4271,7 +4271,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4271
4271
|
}
|
|
4272
4272
|
Pe.NUMTOCENTRIES = 100, Pe.MAXFRAMESIZE = 2880;
|
|
4273
4273
|
function Pe() {
|
|
4274
|
-
this.setModules = function(
|
|
4274
|
+
this.setModules = function(j, y, ye) {
|
|
4275
4275
|
};
|
|
4276
4276
|
var o = [
|
|
4277
4277
|
0,
|
|
@@ -4531,13 +4531,13 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4531
4531
|
32897,
|
|
4532
4532
|
16448
|
|
4533
4533
|
];
|
|
4534
|
-
function A(
|
|
4535
|
-
var ye = y ^
|
|
4534
|
+
function A(j, y) {
|
|
4535
|
+
var ye = y ^ j;
|
|
4536
4536
|
return y = y >> 8 ^ o[ye & 255], y;
|
|
4537
4537
|
}
|
|
4538
|
-
this.updateMusicCRC = function(
|
|
4538
|
+
this.updateMusicCRC = function(j, y, ye, m) {
|
|
4539
4539
|
for (var P = 0; P < m; ++P)
|
|
4540
|
-
|
|
4540
|
+
j[0] = A(y[ye + P], j[0]);
|
|
4541
4541
|
};
|
|
4542
4542
|
}
|
|
4543
4543
|
Je.EQ = function(o, A) {
|
|
@@ -4546,9 +4546,9 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4546
4546
|
return !Je.EQ(o, A);
|
|
4547
4547
|
};
|
|
4548
4548
|
function Je() {
|
|
4549
|
-
var o = this, A = null,
|
|
4549
|
+
var o = this, A = null, j = null;
|
|
4550
4550
|
this.setModules = function(f, p, u, B) {
|
|
4551
|
-
A = u,
|
|
4551
|
+
A = u, j = B;
|
|
4552
4552
|
};
|
|
4553
4553
|
var y = null, ye = 0, m = 0, P = 0;
|
|
4554
4554
|
this.getframebits = function(f) {
|
|
@@ -4558,7 +4558,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4558
4558
|
return 8 * B;
|
|
4559
4559
|
};
|
|
4560
4560
|
function fe(f) {
|
|
4561
|
-
|
|
4561
|
+
G.arraycopy(f.header[f.w_ptr].buf, 0, y, m, f.sideinfo_len), m += f.sideinfo_len, ye += f.sideinfo_len * 8, f.w_ptr = f.w_ptr + 1 & pe.MAX_HEADER_BUF - 1;
|
|
4562
4562
|
}
|
|
4563
4563
|
function N(f, p, u) {
|
|
4564
4564
|
for (; u > 0; ) {
|
|
@@ -4713,7 +4713,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4713
4713
|
}
|
|
4714
4714
|
return $;
|
|
4715
4715
|
}
|
|
4716
|
-
function
|
|
4716
|
+
function q() {
|
|
4717
4717
|
this.total = 0;
|
|
4718
4718
|
}
|
|
4719
4719
|
function g(f, p) {
|
|
@@ -4722,14 +4722,14 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4722
4722
|
}
|
|
4723
4723
|
this.flush_bitstream = function(f) {
|
|
4724
4724
|
var p = f.internal_flags, u, B;
|
|
4725
|
-
p.h_ptr - 1, u = p.l3_side, !((B = g(f, new
|
|
4725
|
+
p.h_ptr - 1, u = p.l3_side, !((B = g(f, new q())) < 0) && (ue(f, B), p.ResvSize = 0, u.main_data_begin = 0, p.findReplayGain && b(), p.findPeakSample && b());
|
|
4726
4726
|
}, this.format_bitstream = function(f) {
|
|
4727
4727
|
var p = f.internal_flags, u;
|
|
4728
4728
|
u = p.l3_side;
|
|
4729
4729
|
var B = this.getframebits(f);
|
|
4730
4730
|
ue(f, u.resvDrain_pre), Te(f, B);
|
|
4731
4731
|
var n = 8 * p.sideinfo_len;
|
|
4732
|
-
if (n += R(f), ue(f, u.resvDrain_post), n += u.resvDrain_post, u.main_data_begin += (B - n) / 8, g(f, new
|
|
4732
|
+
if (n += R(f), ue(f, u.resvDrain_post), n += u.resvDrain_post, u.main_data_begin += (B - n) / 8, g(f, new q()) != p.ResvSize, u.main_data_begin * 8 != p.ResvSize && (p.ResvSize = u.main_data_begin * 8), ye > 1e9) {
|
|
4733
4733
|
var $;
|
|
4734
4734
|
for ($ = 0; $ < pe.MAX_HEADER_BUF; ++$)
|
|
4735
4735
|
p.header[$].write_timing -= ye;
|
|
@@ -4742,17 +4742,17 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
4742
4742
|
return 0;
|
|
4743
4743
|
if (B != 0 && $ > B)
|
|
4744
4744
|
return -1;
|
|
4745
|
-
if (
|
|
4745
|
+
if (G.arraycopy(y, 0, p, u, $), m = -1, P = 0, n != 0) {
|
|
4746
4746
|
var c = _e(1);
|
|
4747
|
-
c[0] = f.nMusicCRC,
|
|
4747
|
+
c[0] = f.nMusicCRC, j.updateMusicCRC(c, p, u, $), f.nMusicCRC = c[0], $ > 0 && (f.VBR_seek_table.nBytesWritten += $), f.decode_on_the_fly && b();
|
|
4748
4748
|
}
|
|
4749
4749
|
return $;
|
|
4750
4750
|
}, this.init_bit_stream_w = function(f) {
|
|
4751
4751
|
y = le(oe.LAME_MAXMP3BUFFER), f.h_ptr = f.w_ptr = 0, f.header[f.h_ptr].write_timing = 0, m = -1, P = 0, ye = 0;
|
|
4752
4752
|
};
|
|
4753
4753
|
}
|
|
4754
|
-
function Ie(o, A,
|
|
4755
|
-
this.xlen = o, this.linmax = A, this.table =
|
|
4754
|
+
function Ie(o, A, j, y) {
|
|
4755
|
+
this.xlen = o, this.linmax = A, this.table = j, this.hlen = y;
|
|
4756
4756
|
}
|
|
4757
4757
|
var M = {};
|
|
4758
4758
|
M.t1HB = [
|
|
@@ -8218,12 +8218,12 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8218
8218
|
}
|
|
8219
8219
|
function Xe(o) {
|
|
8220
8220
|
var A = o;
|
|
8221
|
-
this.quantize = A, this.iteration_loop = function(
|
|
8222
|
-
var P =
|
|
8223
|
-
this.quantize.rv.ResvFrameBegin(
|
|
8221
|
+
this.quantize = A, this.iteration_loop = function(j, y, ye, m) {
|
|
8222
|
+
var P = j.internal_flags, fe = H(h.SFBMAX), N = H(576), ue = _e(2), O = 0, Te = P.l3_side, L = new Be(O);
|
|
8223
|
+
this.quantize.rv.ResvFrameBegin(j, L), O = L.bits;
|
|
8224
8224
|
for (var Y = 0; Y < P.mode_gr; Y++) {
|
|
8225
8225
|
this.quantize.qupvt.on_pe(
|
|
8226
|
-
|
|
8226
|
+
j,
|
|
8227
8227
|
y,
|
|
8228
8228
|
ue,
|
|
8229
8229
|
O,
|
|
@@ -8231,18 +8231,18 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8231
8231
|
Y
|
|
8232
8232
|
), P.mode_ext == i.MPG_MD_MS_LR && b();
|
|
8233
8233
|
for (var t = 0; t < P.channels_out; t++) {
|
|
8234
|
-
var l, R,
|
|
8235
|
-
|
|
8234
|
+
var l, R, q = Te.tt[Y][t];
|
|
8235
|
+
q.block_type != i.SHORT_TYPE ? (l = 0, R = P.PSY.mask_adjust - l) : (l = 0, R = P.PSY.mask_adjust_short - l), P.masking_lower = Math.pow(
|
|
8236
8236
|
10,
|
|
8237
8237
|
R * 0.1
|
|
8238
|
-
), this.quantize.init_outer_loop(P,
|
|
8239
|
-
|
|
8238
|
+
), this.quantize.init_outer_loop(P, q), this.quantize.init_xrpow(P, q, N) && (this.quantize.qupvt.calc_xmin(
|
|
8239
|
+
j,
|
|
8240
8240
|
m[Y][t],
|
|
8241
|
-
|
|
8241
|
+
q,
|
|
8242
8242
|
fe
|
|
8243
8243
|
), this.quantize.outer_loop(
|
|
8244
|
-
|
|
8245
|
-
|
|
8244
|
+
j,
|
|
8245
|
+
q,
|
|
8246
8246
|
fe,
|
|
8247
8247
|
N,
|
|
8248
8248
|
t,
|
|
@@ -8255,16 +8255,16 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8255
8255
|
}
|
|
8256
8256
|
function He() {
|
|
8257
8257
|
}
|
|
8258
|
-
function k(o, A,
|
|
8258
|
+
function k(o, A, j, y) {
|
|
8259
8259
|
this.l = _e(1 + i.SBMAX_l), this.s = _e(1 + i.SBMAX_s), this.psfb21 = _e(1 + i.PSFB21), this.psfb12 = _e(1 + i.PSFB12);
|
|
8260
8260
|
var ye = this.l, m = this.s;
|
|
8261
|
-
arguments.length == 4 && (this.arrL = arguments[0], this.arrS = arguments[1], this.arr21 = arguments[2], this.arr12 = arguments[3],
|
|
8261
|
+
arguments.length == 4 && (this.arrL = arguments[0], this.arrS = arguments[1], this.arr21 = arguments[2], this.arr12 = arguments[3], G.arraycopy(this.arrL, 0, ye, 0, Math.min(this.arrL.length, this.l.length)), G.arraycopy(this.arrS, 0, m, 0, Math.min(this.arrS.length, this.s.length)), G.arraycopy(this.arr21, 0, this.psfb21, 0, Math.min(this.arr21.length, this.psfb21.length)), G.arraycopy(this.arr12, 0, this.psfb12, 0, Math.min(this.arr12.length, this.psfb12.length)));
|
|
8262
8262
|
}
|
|
8263
8263
|
e.Q_MAX = 257, e.Q_MAX2 = 116, e.LARGE_BITS = 1e5, e.IXMAX_VAL = 8206;
|
|
8264
8264
|
function e() {
|
|
8265
|
-
var o = null, A = null,
|
|
8265
|
+
var o = null, A = null, j = null;
|
|
8266
8266
|
this.setModules = function(g, f, p) {
|
|
8267
|
-
o = g, A = f,
|
|
8267
|
+
o = g, A = f, j = p;
|
|
8268
8268
|
};
|
|
8269
8269
|
function y(g) {
|
|
8270
8270
|
return Te[g + e.Q_MAX2];
|
|
@@ -8644,7 +8644,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8644
8644
|
var Te = H(fe + N + 1), L = H(fe), Y = H(P), t = H(P);
|
|
8645
8645
|
this.adj43 = t;
|
|
8646
8646
|
function l(g, f) {
|
|
8647
|
-
var p =
|
|
8647
|
+
var p = j.ATHformula(f, g);
|
|
8648
8648
|
return p -= ue, p = Math.pow(10, p / 10 + g.ATHlower), p;
|
|
8649
8649
|
}
|
|
8650
8650
|
function R(g) {
|
|
@@ -8779,7 +8779,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8779
8779
|
}
|
|
8780
8780
|
return v;
|
|
8781
8781
|
};
|
|
8782
|
-
function
|
|
8782
|
+
function q(g) {
|
|
8783
8783
|
this.s = g;
|
|
8784
8784
|
}
|
|
8785
8785
|
this.calc_noise_core = function(g, f, p, u) {
|
|
@@ -8813,7 +8813,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8813
8813
|
var Ne;
|
|
8814
8814
|
Ne = g.max_nonzero_coeff - r + 1, Ne > 0 ? v = Ne >> 1 : v = 0;
|
|
8815
8815
|
}
|
|
8816
|
-
var Qe = new
|
|
8816
|
+
var Qe = new q(r);
|
|
8817
8817
|
xe = this.calc_noise_core(g, Qe, v, De), r = Qe.s, B != null && (B.step[c] = Z, B.noise[c] = xe), xe = p[n++] = xe / f[$++], xe = I.FAST_LOG10(Math.max(xe, 1e-20)), B != null && (B.noise_log[c] = xe);
|
|
8818
8818
|
}
|
|
8819
8819
|
if (B != null && (B.global_gain = g.global_gain), E += xe, xe > 0) {
|
|
@@ -8834,11 +8834,11 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8834
8834
|
function A(y) {
|
|
8835
8835
|
return new Int32Array(y);
|
|
8836
8836
|
}
|
|
8837
|
-
function
|
|
8837
|
+
function j(y) {
|
|
8838
8838
|
return new Float32Array(y);
|
|
8839
8839
|
}
|
|
8840
8840
|
this.assign = function(y) {
|
|
8841
|
-
o.xr =
|
|
8841
|
+
o.xr = j(y.xr), o.l3_enc = A(y.l3_enc), o.scalefac = A(y.scalefac), o.xrpow_max = y.xrpow_max, o.part2_3_length = y.part2_3_length, o.big_values = y.big_values, o.count1 = y.count1, o.global_gain = y.global_gain, o.scalefac_compress = y.scalefac_compress, o.block_type = y.block_type, o.mixed_block_flag = y.mixed_block_flag, o.table_select = A(y.table_select), o.subblock_gain = A(y.subblock_gain), o.region0_count = y.region0_count, o.region1_count = y.region1_count, o.preflag = y.preflag, o.scalefac_scale = y.scalefac_scale, o.count1table_select = y.count1table_select, o.part2_length = y.part2_length, o.sfb_lmax = y.sfb_lmax, o.sfb_smin = y.sfb_smin, o.psy_lmax = y.psy_lmax, o.sfbmax = y.sfbmax, o.psymax = y.psymax, o.sfbdivide = y.sfbdivide, o.width = A(y.width), o.window = A(y.window), o.count1bits = y.count1bits, o.sfb_partition_table = y.sfb_partition_table.slice(0), o.slen = A(y.slen), o.max_nonzero_coeff = y.max_nonzero_coeff;
|
|
8842
8842
|
};
|
|
8843
8843
|
}
|
|
8844
8844
|
var h = {};
|
|
@@ -8847,21 +8847,21 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8847
8847
|
this.rv = null;
|
|
8848
8848
|
var o;
|
|
8849
8849
|
this.qupvt = null;
|
|
8850
|
-
var A,
|
|
8851
|
-
this.setModules = function(t, l, R,
|
|
8852
|
-
o = l, this.rv = l, A = R, this.qupvt = R, y =
|
|
8850
|
+
var A, j = new Me(), y;
|
|
8851
|
+
this.setModules = function(t, l, R, q) {
|
|
8852
|
+
o = l, this.rv = l, A = R, this.qupvt = R, y = q, j.setModules(A, y);
|
|
8853
8853
|
};
|
|
8854
|
-
function ye(t, l, R,
|
|
8855
|
-
|
|
8854
|
+
function ye(t, l, R, q) {
|
|
8855
|
+
q = 0;
|
|
8856
8856
|
for (var g = 0; g <= R; ++g) {
|
|
8857
8857
|
var f = Math.abs(t.xr[g]);
|
|
8858
|
-
|
|
8858
|
+
q += f, l[g] = Math.sqrt(f * Math.sqrt(f)), l[g] > t.xrpow_max && (t.xrpow_max = l[g]);
|
|
8859
8859
|
}
|
|
8860
|
-
return
|
|
8860
|
+
return q;
|
|
8861
8861
|
}
|
|
8862
8862
|
this.init_xrpow = function(t, l, R) {
|
|
8863
|
-
var
|
|
8864
|
-
if (l.xrpow_max = 0, ge.fill(R, g, 576, 0),
|
|
8863
|
+
var q = 0, g = 0 | l.max_nonzero_coeff;
|
|
8864
|
+
if (l.xrpow_max = 0, ge.fill(R, g, 576, 0), q = ye(l, R, g, q), q > 1e-20) {
|
|
8865
8865
|
var f = 0;
|
|
8866
8866
|
t.substep_shaping & 2 && (f = 1);
|
|
8867
8867
|
for (var p = 0; p < l.psymax; p++)
|
|
@@ -8871,7 +8871,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8871
8871
|
return ge.fill(l.l3_enc, 0, 576, 0), !1;
|
|
8872
8872
|
};
|
|
8873
8873
|
function m(t, l) {
|
|
8874
|
-
var R = t.ATH,
|
|
8874
|
+
var R = t.ATH, q = l.xr;
|
|
8875
8875
|
if (l.block_type != i.SHORT_TYPE)
|
|
8876
8876
|
for (var g = !1, f = i.PSFB21 - 1; f >= 0 && !g; f--) {
|
|
8877
8877
|
var p = t.scalefac_band.psfb21[f], u = t.scalefac_band.psfb21[f + 1], B = A.athAdjust(
|
|
@@ -8881,8 +8881,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8881
8881
|
);
|
|
8882
8882
|
t.nsPsy.longfact[21] > 1e-12 && (B *= t.nsPsy.longfact[21]);
|
|
8883
8883
|
for (var n = u - 1; n >= p; n--)
|
|
8884
|
-
if (Math.abs(
|
|
8885
|
-
|
|
8884
|
+
if (Math.abs(q[n]) < B)
|
|
8885
|
+
q[n] = 0;
|
|
8886
8886
|
else {
|
|
8887
8887
|
g = !0;
|
|
8888
8888
|
break;
|
|
@@ -8898,8 +8898,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8898
8898
|
);
|
|
8899
8899
|
t.nsPsy.shortfact[12] > 1e-12 && (c *= t.nsPsy.shortfact[12]);
|
|
8900
8900
|
for (var n = u - 1; n >= p; n--)
|
|
8901
|
-
if (Math.abs(
|
|
8902
|
-
|
|
8901
|
+
if (Math.abs(q[n]) < c)
|
|
8902
|
+
q[n] = 0;
|
|
8903
8903
|
else {
|
|
8904
8904
|
g = !0;
|
|
8905
8905
|
break;
|
|
@@ -8911,14 +8911,14 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8911
8911
|
for (var R = 0; R < i.SBMAX_l; R++)
|
|
8912
8912
|
l.width[R] = t.scalefac_band.l[R + 1] - t.scalefac_band.l[R], l.window[R] = 3;
|
|
8913
8913
|
if (l.block_type == i.SHORT_TYPE) {
|
|
8914
|
-
var
|
|
8914
|
+
var q = H(576);
|
|
8915
8915
|
l.sfb_smin = 0, l.sfb_lmax = 0, l.mixed_block_flag != 0 && b(), l.psymax = l.sfb_lmax + 3 * ((t.sfb21_extra ? i.SBMAX_s : i.SBPSY_s) - l.sfb_smin), l.sfbmax = l.sfb_lmax + 3 * (i.SBPSY_s - l.sfb_smin), l.sfbdivide = l.sfbmax - 18, l.psy_lmax = l.sfb_lmax;
|
|
8916
8916
|
var g = t.scalefac_band.l[l.sfb_lmax];
|
|
8917
|
-
|
|
8917
|
+
G.arraycopy(l.xr, 0, q, 0, 576);
|
|
8918
8918
|
for (var R = l.sfb_smin; R < i.SBMAX_s; R++)
|
|
8919
8919
|
for (var f = t.scalefac_band.s[R], p = t.scalefac_band.s[R + 1], u = 0; u < 3; u++)
|
|
8920
8920
|
for (var B = f; B < p; B++)
|
|
8921
|
-
l.xr[g++] =
|
|
8921
|
+
l.xr[g++] = q[3 * B + u];
|
|
8922
8922
|
for (var n = l.sfb_lmax, R = l.sfb_smin; R < i.SBMAX_s; R++)
|
|
8923
8923
|
l.width[n] = l.width[n + 1] = l.width[n + 2] = t.scalefac_band.s[R + 1] - t.scalefac_band.s[R], l.window[n] = 0, l.window[n + 1] = 1, l.window[n + 2] = 2, n += 3;
|
|
8924
8924
|
}
|
|
@@ -8928,8 +8928,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8928
8928
|
this.ordinal = t;
|
|
8929
8929
|
}
|
|
8930
8930
|
P.BINSEARCH_NONE = new P(0), P.BINSEARCH_UP = new P(1), P.BINSEARCH_DOWN = new P(2);
|
|
8931
|
-
function fe(t, l, R,
|
|
8932
|
-
var f, p = t.CurrentStep[
|
|
8931
|
+
function fe(t, l, R, q, g) {
|
|
8932
|
+
var f, p = t.CurrentStep[q], u = !1, B = t.OldValue[q], n = P.BINSEARCH_NONE;
|
|
8933
8933
|
for (l.global_gain = B, R -= l.part2_length; ; ) {
|
|
8934
8934
|
var $;
|
|
8935
8935
|
if (f = y.count_bits(t, g, l, null), p == 1 || f == R)
|
|
@@ -8938,7 +8938,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8938
8938
|
}
|
|
8939
8939
|
for (; f > R && l.global_gain < 255; )
|
|
8940
8940
|
l.global_gain++, f = y.count_bits(t, g, l, null);
|
|
8941
|
-
return t.CurrentStep[
|
|
8941
|
+
return t.CurrentStep[q] = B - l.global_gain >= 4 ? 4 : 2, t.OldValue[q] = l.global_gain, l.part2_3_length = f, f;
|
|
8942
8942
|
}
|
|
8943
8943
|
function N(t) {
|
|
8944
8944
|
for (var l = 0; l < t.sfbmax; l++)
|
|
@@ -8946,7 +8946,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8946
8946
|
return !1;
|
|
8947
8947
|
return !0;
|
|
8948
8948
|
}
|
|
8949
|
-
function ue(t, l, R,
|
|
8949
|
+
function ue(t, l, R, q, g) {
|
|
8950
8950
|
var f;
|
|
8951
8951
|
switch (t) {
|
|
8952
8952
|
default:
|
|
@@ -8983,7 +8983,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
8983
8983
|
}
|
|
8984
8984
|
return l.over_count == 0 && (f = f && R.bits < l.bits), f;
|
|
8985
8985
|
}
|
|
8986
|
-
function O(t, l, R,
|
|
8986
|
+
function O(t, l, R, q, g) {
|
|
8987
8987
|
var f = t.internal_flags, p;
|
|
8988
8988
|
l.scalefac_scale == 0 ? p = 1.2968395546510096 : p = 1.6817928305074292;
|
|
8989
8989
|
for (var u = 0, B = 0; B < l.sfbmax; B++)
|
|
@@ -9004,47 +9004,47 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9004
9004
|
var c = l.width[B], v;
|
|
9005
9005
|
if ($ += c, !(R[B] < u)) {
|
|
9006
9006
|
for (f.substep_shaping & 2 && b(), l.scalefac[B]++, v = -c; v < 0; v++)
|
|
9007
|
-
|
|
9007
|
+
q[$ + v] *= p, q[$ + v] > l.xrpow_max && (l.xrpow_max = q[$ + v]);
|
|
9008
9008
|
if (f.noise_shaping_amp == 2)
|
|
9009
9009
|
return;
|
|
9010
9010
|
}
|
|
9011
9011
|
}
|
|
9012
9012
|
}
|
|
9013
9013
|
function Te(t, l) {
|
|
9014
|
-
for (var R = 1.2968395546510096,
|
|
9014
|
+
for (var R = 1.2968395546510096, q = 0, g = 0; g < t.sfbmax; g++) {
|
|
9015
9015
|
var f = t.width[g], p = t.scalefac[g];
|
|
9016
|
-
if (t.preflag != 0 && (p += A.pretab[g]),
|
|
9016
|
+
if (t.preflag != 0 && (p += A.pretab[g]), q += f, p & 1) {
|
|
9017
9017
|
p++;
|
|
9018
9018
|
for (var u = -f; u < 0; u++)
|
|
9019
|
-
l[
|
|
9019
|
+
l[q + u] *= R, l[q + u] > t.xrpow_max && (t.xrpow_max = l[q + u]);
|
|
9020
9020
|
}
|
|
9021
9021
|
t.scalefac[g] = p >> 1;
|
|
9022
9022
|
}
|
|
9023
9023
|
t.preflag = 0, t.scalefac_scale = 1;
|
|
9024
9024
|
}
|
|
9025
9025
|
function L(t, l, R) {
|
|
9026
|
-
var
|
|
9027
|
-
for (
|
|
9028
|
-
if (g[
|
|
9026
|
+
var q, g = l.scalefac;
|
|
9027
|
+
for (q = 0; q < l.sfb_lmax; q++)
|
|
9028
|
+
if (g[q] >= 16)
|
|
9029
9029
|
return !0;
|
|
9030
9030
|
for (var f = 0; f < 3; f++) {
|
|
9031
9031
|
var p = 0, u = 0;
|
|
9032
|
-
for (
|
|
9033
|
-
p < g[
|
|
9034
|
-
for (;
|
|
9035
|
-
u < g[
|
|
9032
|
+
for (q = l.sfb_lmax + f; q < l.sfbdivide; q += 3)
|
|
9033
|
+
p < g[q] && (p = g[q]);
|
|
9034
|
+
for (; q < l.sfbmax; q += 3)
|
|
9035
|
+
u < g[q] && (u = g[q]);
|
|
9036
9036
|
if (!(p < 16 && u < 8)) {
|
|
9037
9037
|
if (l.subblock_gain[f] >= 7)
|
|
9038
9038
|
return !0;
|
|
9039
9039
|
l.subblock_gain[f]++;
|
|
9040
9040
|
var B = t.scalefac_band.l[l.sfb_lmax];
|
|
9041
|
-
for (
|
|
9042
|
-
var n, $ = l.width[
|
|
9041
|
+
for (q = l.sfb_lmax + f; q < l.sfbmax; q += 3) {
|
|
9042
|
+
var n, $ = l.width[q], c = g[q];
|
|
9043
9043
|
if (c = c - (4 >> l.scalefac_scale), c >= 0) {
|
|
9044
|
-
g[
|
|
9044
|
+
g[q] = c, B += $ * 3;
|
|
9045
9045
|
continue;
|
|
9046
9046
|
}
|
|
9047
|
-
g[
|
|
9047
|
+
g[q] = 0;
|
|
9048
9048
|
{
|
|
9049
9049
|
var v = 210 + (c << l.scalefac_scale + 1);
|
|
9050
9050
|
n = A.IPOW20(v);
|
|
@@ -9056,23 +9056,23 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9056
9056
|
}
|
|
9057
9057
|
{
|
|
9058
9058
|
var n = A.IPOW20(202);
|
|
9059
|
-
B += l.width[
|
|
9060
|
-
for (var _ = -l.width[
|
|
9059
|
+
B += l.width[q] * (f + 1);
|
|
9060
|
+
for (var _ = -l.width[q]; _ < 0; _++)
|
|
9061
9061
|
R[B + _] *= n, R[B + _] > l.xrpow_max && (l.xrpow_max = R[B + _]);
|
|
9062
9062
|
}
|
|
9063
9063
|
}
|
|
9064
9064
|
}
|
|
9065
9065
|
return !1;
|
|
9066
9066
|
}
|
|
9067
|
-
function Y(t, l, R,
|
|
9067
|
+
function Y(t, l, R, q, g) {
|
|
9068
9068
|
var f = t.internal_flags;
|
|
9069
|
-
O(t, l, R,
|
|
9069
|
+
O(t, l, R, q);
|
|
9070
9070
|
var p = N(l);
|
|
9071
|
-
return p ? !1 : (f.mode_gr == 2 ? p = y.scale_bitcount(l) : p = y.scale_bitcount_lsf(f, l), p ? (f.noise_shaping > 1 && (ge.fill(f.pseudohalf, 0), l.scalefac_scale == 0 ? (Te(l,
|
|
9071
|
+
return p ? !1 : (f.mode_gr == 2 ? p = y.scale_bitcount(l) : p = y.scale_bitcount_lsf(f, l), p ? (f.noise_shaping > 1 && (ge.fill(f.pseudohalf, 0), l.scalefac_scale == 0 ? (Te(l, q), p = !1) : l.block_type == i.SHORT_TYPE && f.subblock_gain > 0 && (p = L(f, l, q) || N(l))), p || (f.mode_gr == 2 ? p = y.scale_bitcount(l) : p = y.scale_bitcount_lsf(f, l)), !p) : !0);
|
|
9072
9072
|
}
|
|
9073
|
-
this.outer_loop = function(t, l, R,
|
|
9073
|
+
this.outer_loop = function(t, l, R, q, g, f) {
|
|
9074
9074
|
var p = t.internal_flags, u = new d(), B = H(576), n = H(h.SFBMAX), $ = new Ve(), c, v = new s(), _ = 9999999, S = !1, E = !1, a = 0;
|
|
9075
|
-
if (fe(p, l, f, g,
|
|
9075
|
+
if (fe(p, l, f, g, q), p.noise_shaping == 0)
|
|
9076
9076
|
return 100;
|
|
9077
9077
|
A.calc_noise(
|
|
9078
9078
|
l,
|
|
@@ -9082,10 +9082,10 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9082
9082
|
v
|
|
9083
9083
|
), $.bits = l.part2_3_length, u.assign(l);
|
|
9084
9084
|
var r = 0;
|
|
9085
|
-
for (
|
|
9085
|
+
for (G.arraycopy(q, 0, B, 0, 576); !S; ) {
|
|
9086
9086
|
do {
|
|
9087
9087
|
var J = new Ve(), D, Z = 255;
|
|
9088
|
-
if (p.substep_shaping & 2 ? D = 20 : D = 3, p.sfb21_extra && b(), !Y(t, u, n,
|
|
9088
|
+
if (p.substep_shaping & 2 ? D = 20 : D = 3, p.sfb21_extra && b(), !Y(t, u, n, q))
|
|
9089
9089
|
break;
|
|
9090
9090
|
u.scalefac_scale != 0 && (Z = 254);
|
|
9091
9091
|
var xe = f - u.part2_length;
|
|
@@ -9093,7 +9093,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9093
9093
|
break;
|
|
9094
9094
|
for (; (u.part2_3_length = y.count_bits(
|
|
9095
9095
|
p,
|
|
9096
|
-
|
|
9096
|
+
q,
|
|
9097
9097
|
u,
|
|
9098
9098
|
v
|
|
9099
9099
|
)) > xe && u.global_gain <= Z; )
|
|
@@ -9103,7 +9103,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9103
9103
|
if ($.over_count == 0) {
|
|
9104
9104
|
for (; (u.part2_3_length = y.count_bits(
|
|
9105
9105
|
p,
|
|
9106
|
-
|
|
9106
|
+
q,
|
|
9107
9107
|
u,
|
|
9108
9108
|
v
|
|
9109
9109
|
)) > _ && u.global_gain <= Z; )
|
|
@@ -9118,16 +9118,16 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9118
9118
|
J,
|
|
9119
9119
|
v
|
|
9120
9120
|
), J.bits = u.part2_3_length, l.block_type != i.SHORT_TYPE ? c = t.quant_comp : c = t.quant_comp_short, c = ue(c, $, J) ? 1 : 0, c != 0)
|
|
9121
|
-
_ = l.part2_3_length, $ = J, l.assign(u), r = 0,
|
|
9121
|
+
_ = l.part2_3_length, $ = J, l.assign(u), r = 0, G.arraycopy(q, 0, B, 0, 576);
|
|
9122
9122
|
else if (p.full_outer_loop == 0 && (++r > D && $.over_count == 0 || p.noise_shaping_amp == 3 && E && r > 30 || p.noise_shaping_amp == 3 && E && u.global_gain - a > 15))
|
|
9123
9123
|
break;
|
|
9124
9124
|
} while (u.global_gain + u.scalefac_scale < 255);
|
|
9125
9125
|
p.noise_shaping_amp == 3 ? b() : S = !0;
|
|
9126
9126
|
}
|
|
9127
|
-
return t.VBR == T.vbr_rh || t.VBR == T.vbr_mtrh ?
|
|
9127
|
+
return t.VBR == T.vbr_rh || t.VBR == T.vbr_mtrh ? G.arraycopy(B, 0, q, 0, 576) : p.substep_shaping & 1 && b(), $.over_count;
|
|
9128
9128
|
}, this.iteration_finish_one = function(t, l, R) {
|
|
9129
|
-
var
|
|
9130
|
-
y.best_scalefac_store(t, l, R,
|
|
9129
|
+
var q = t.l3_side, g = q.tt[l][R];
|
|
9130
|
+
y.best_scalefac_store(t, l, R, q), t.use_best_huffman == 1 && y.best_huffman_divide(t, g), o.ResvAdjust(t, g);
|
|
9131
9131
|
};
|
|
9132
9132
|
}
|
|
9133
9133
|
function W() {
|
|
@@ -9431,7 +9431,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9431
9431
|
9.000838926174497,
|
|
9432
9432
|
-29.20218120805369
|
|
9433
9433
|
/* 2.384e-06/2.384e-06 */
|
|
9434
|
-
], A = 12,
|
|
9434
|
+
], A = 12, j = 36, y = [
|
|
9435
9435
|
[
|
|
9436
9436
|
2382191739347913e-28,
|
|
9437
9437
|
6423305872147834e-28,
|
|
@@ -9624,9 +9624,9 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9624
9624
|
31
|
|
9625
9625
|
];
|
|
9626
9626
|
function ue(L, Y, t) {
|
|
9627
|
-
for (var l = 10, R = Y + 238 - 14 - 286,
|
|
9627
|
+
for (var l = 10, R = Y + 238 - 14 - 286, q = -15; q < 0; q++) {
|
|
9628
9628
|
var g, f, p;
|
|
9629
|
-
g = o[l + -10], f = L[R + -224] * g, p = L[Y + 224] * g, g = o[l + -9], f += L[R + -160] * g, p += L[Y + 160] * g, g = o[l + -8], f += L[R + -96] * g, p += L[Y + 96] * g, g = o[l + -7], f += L[R + -32] * g, p += L[Y + 32] * g, g = o[l + -6], f += L[R + 32] * g, p += L[Y + -32] * g, g = o[l + -5], f += L[R + 96] * g, p += L[Y + -96] * g, g = o[l + -4], f += L[R + 160] * g, p += L[Y + -160] * g, g = o[l + -3], f += L[R + 224] * g, p += L[Y + -224] * g, g = o[l + -2], f += L[Y + -256] * g, p -= L[R + 256] * g, g = o[l + -1], f += L[Y + -192] * g, p -= L[R + 192] * g, g = o[l + 0], f += L[Y + -128] * g, p -= L[R + 128] * g, g = o[l + 1], f += L[Y + -64] * g, p -= L[R + 64] * g, g = o[l + 2], f += L[Y + 0] * g, p -= L[R + 0] * g, g = o[l + 3], f += L[Y + 64] * g, p -= L[R + -64] * g, g = o[l + 4], f += L[Y + 128] * g, p -= L[R + -128] * g, g = o[l + 5], f += L[Y + 192] * g, p -= L[R + -192] * g, f *= o[l + 6], g = p - f, t[30 +
|
|
9629
|
+
g = o[l + -10], f = L[R + -224] * g, p = L[Y + 224] * g, g = o[l + -9], f += L[R + -160] * g, p += L[Y + 160] * g, g = o[l + -8], f += L[R + -96] * g, p += L[Y + 96] * g, g = o[l + -7], f += L[R + -32] * g, p += L[Y + 32] * g, g = o[l + -6], f += L[R + 32] * g, p += L[Y + -32] * g, g = o[l + -5], f += L[R + 96] * g, p += L[Y + -96] * g, g = o[l + -4], f += L[R + 160] * g, p += L[Y + -160] * g, g = o[l + -3], f += L[R + 224] * g, p += L[Y + -224] * g, g = o[l + -2], f += L[Y + -256] * g, p -= L[R + 256] * g, g = o[l + -1], f += L[Y + -192] * g, p -= L[R + 192] * g, g = o[l + 0], f += L[Y + -128] * g, p -= L[R + 128] * g, g = o[l + 1], f += L[Y + -64] * g, p -= L[R + 64] * g, g = o[l + 2], f += L[Y + 0] * g, p -= L[R + 0] * g, g = o[l + 3], f += L[Y + 64] * g, p -= L[R + -64] * g, g = o[l + 4], f += L[Y + 128] * g, p -= L[R + -128] * g, g = o[l + 5], f += L[Y + 192] * g, p -= L[R + -192] * g, f *= o[l + 6], g = p - f, t[30 + q * 2] = p + f, t[31 + q * 2] = o[l + 7] * g, l += 18, Y--, R++;
|
|
9630
9630
|
}
|
|
9631
9631
|
{
|
|
9632
9632
|
var f, p, u, B;
|
|
@@ -9639,15 +9639,15 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9639
9639
|
}
|
|
9640
9640
|
function O(L, Y) {
|
|
9641
9641
|
for (var t = 0; t < 3; t++) {
|
|
9642
|
-
var l, R,
|
|
9643
|
-
g = L[Y + 2 * 3] * y[i.SHORT_TYPE][0] - L[Y + 5 * 3], l = L[Y + 0 * 3] * y[i.SHORT_TYPE][2] - L[Y + 3 * 3], R = g + l,
|
|
9642
|
+
var l, R, q, g, f, p;
|
|
9643
|
+
g = L[Y + 2 * 3] * y[i.SHORT_TYPE][0] - L[Y + 5 * 3], l = L[Y + 0 * 3] * y[i.SHORT_TYPE][2] - L[Y + 3 * 3], R = g + l, q = g - l, g = L[Y + 5 * 3] * y[i.SHORT_TYPE][0] + L[Y + 2 * 3], l = L[Y + 3 * 3] * y[i.SHORT_TYPE][2] + L[Y + 0 * 3], f = g + l, p = -g + l, l = (L[Y + 1 * 3] * y[i.SHORT_TYPE][1] - L[Y + 4 * 3]) * 2069978111953089e-26, g = (L[Y + 4 * 3] * y[i.SHORT_TYPE][1] + L[Y + 1 * 3]) * 2069978111953089e-26, L[Y + 3 * 0] = R * 190752519173728e-25 + l, L[Y + 3 * 5] = -f * 190752519173728e-25 + g, q = q * 0.8660254037844387 * 1907525191737281e-26, f = f * 0.5 * 1907525191737281e-26 + g, L[Y + 3 * 1] = q - f, L[Y + 3 * 2] = q + f, R = R * 0.5 * 1907525191737281e-26 - l, p = p * 0.8660254037844387 * 1907525191737281e-26, L[Y + 3 * 3] = R + p, L[Y + 3 * 4] = R - p, Y++;
|
|
9644
9644
|
}
|
|
9645
9645
|
}
|
|
9646
9646
|
function Te(L, Y, t) {
|
|
9647
9647
|
var l, R;
|
|
9648
9648
|
{
|
|
9649
|
-
var
|
|
9650
|
-
|
|
9649
|
+
var q, g, f, p, u, B, n, $;
|
|
9650
|
+
q = t[17] - t[9], f = t[15] - t[11], p = t[14] - t[12], u = t[0] + t[8], B = t[1] + t[7], n = t[2] + t[6], $ = t[3] + t[5], L[Y + 17] = u + n - $ - (B - t[4]), R = (u + n - $) * m[19] + (B - t[4]), l = (q - f - p) * m[18], L[Y + 5] = l + R, L[Y + 6] = l - R, g = (t[16] - t[10]) * m[18], B = B * m[19] + t[4], l = q * m[12] + g + f * m[13] + p * m[14], R = -u * m[16] + B - n * m[17] + $ * m[15], L[Y + 1] = l + R, L[Y + 2] = l - R, l = q * m[13] - g - f * m[14] + p * m[12], R = -u * m[17] + B - n * m[15] + $ * m[16], L[Y + 9] = l + R, L[Y + 10] = l - R, l = q * m[14] - g + f * m[12] - p * m[13], R = u * m[15] - B + n * m[16] - $ * m[17], L[Y + 13] = l + R, L[Y + 14] = l - R;
|
|
9651
9651
|
}
|
|
9652
9652
|
{
|
|
9653
9653
|
var c, v, _, S, E, a, r, J;
|
|
@@ -9655,13 +9655,13 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9655
9655
|
}
|
|
9656
9656
|
}
|
|
9657
9657
|
this.mdct_sub48 = function(L, Y, t) {
|
|
9658
|
-
for (var l = Y, R = 286,
|
|
9658
|
+
for (var l = Y, R = 286, q = 0; q < L.channels_out; q++) {
|
|
9659
9659
|
for (var g = 0; g < L.mode_gr; g++) {
|
|
9660
|
-
for (var f, p = L.l3_side.tt[g][
|
|
9660
|
+
for (var f, p = L.l3_side.tt[g][q], u = p.xr, B = 0, n = L.sb_sample[q][1 - g], $ = 0, c = 0; c < 18 / 2; c++)
|
|
9661
9661
|
for (ue(l, R, n[$]), ue(l, R + 32, n[$ + 1]), $ += 2, R += 64, f = 1; f < 32; f += 2)
|
|
9662
9662
|
n[$ - 1][f] *= -1;
|
|
9663
9663
|
for (f = 0; f < 32; f++, B += 18) {
|
|
9664
|
-
var v = p.block_type, _ = L.sb_sample[
|
|
9664
|
+
var v = p.block_type, _ = L.sb_sample[q][g], S = L.sb_sample[q][1 - g];
|
|
9665
9665
|
if (p.mixed_block_flag != 0 && f < 2 && (v = 0), L.amp_filter[f] < 1e-12)
|
|
9666
9666
|
ge.fill(
|
|
9667
9667
|
u,
|
|
@@ -9676,7 +9676,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9676
9676
|
}
|
|
9677
9677
|
O(u, B);
|
|
9678
9678
|
} else {
|
|
9679
|
-
for (var a = H(18), c = -
|
|
9679
|
+
for (var a = H(18), c = -j / 4; c < 0; c++) {
|
|
9680
9680
|
var r, J;
|
|
9681
9681
|
r = y[v][c + 27] * S[c + 9][N[f]] + y[v][c + 36] * S[8 - c][N[f]], J = y[v][c + 9] * _[c + 9][N[f]] - y[v][c + 18] * _[8 - c][N[f]], a[c + 9] = r - J * ye[3 + c + 9], a[c + 18] = r * ye[3 + c + 9] + J;
|
|
9682
9682
|
}
|
|
@@ -9691,10 +9691,10 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9691
9691
|
}
|
|
9692
9692
|
if (l = t, R = 286, L.mode_gr == 1)
|
|
9693
9693
|
for (var xe = 0; xe < 18; xe++)
|
|
9694
|
-
|
|
9695
|
-
L.sb_sample[
|
|
9694
|
+
G.arraycopy(
|
|
9695
|
+
L.sb_sample[q][1][xe],
|
|
9696
9696
|
0,
|
|
9697
|
-
L.sb_sample[
|
|
9697
|
+
L.sb_sample[q][0][xe],
|
|
9698
9698
|
0,
|
|
9699
9699
|
32
|
|
9700
9700
|
);
|
|
@@ -9718,9 +9718,9 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9718
9718
|
function i() {
|
|
9719
9719
|
var o = i.MPG_MD_MS_LR, A = null;
|
|
9720
9720
|
this.psy = null;
|
|
9721
|
-
var
|
|
9721
|
+
var j = null, y = null;
|
|
9722
9722
|
this.setModules = function(N, ue, O, Te) {
|
|
9723
|
-
A = N, this.psy = ue,
|
|
9723
|
+
A = N, this.psy = ue, j = ue, y = Te;
|
|
9724
9724
|
};
|
|
9725
9725
|
var ye = new W();
|
|
9726
9726
|
function m(N) {
|
|
@@ -9761,13 +9761,13 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9761
9761
|
l[0][0] = new x(), l[0][1] = new x(), l[1][0] = new x(), l[1][1] = new x();
|
|
9762
9762
|
var R = Le([2, 2]);
|
|
9763
9763
|
R[0][0] = new x(), R[0][1] = new x(), R[1][0] = new x(), R[1][1] = new x();
|
|
9764
|
-
var
|
|
9764
|
+
var q, g = [null, null], f = N.internal_flags, p = he([2, 4]), u = [0.5, 0.5], B = [[0, 0], [0, 0]], n = [[0, 0], [0, 0]], $, c, v;
|
|
9765
9765
|
if (g[0] = ue, g[1] = O, f.lame_encode_frame_init == 0 && fe(N, g), f.padding = 0, (f.slot_lag -= f.frac_SpF) < 0 && (f.slot_lag += N.out_samplerate, f.padding = 1), f.psymodel != 0) {
|
|
9766
9766
|
var _, S = [null, null], E = 0, a = _e(2);
|
|
9767
9767
|
for (v = 0; v < f.mode_gr; v++) {
|
|
9768
9768
|
for (c = 0; c < f.channels_out; c++)
|
|
9769
9769
|
S[c] = g[c], E = 576 + v * 576 - i.FFTOFFSET;
|
|
9770
|
-
if (N.VBR == T.vbr_mtrh || N.VBR == T.vbr_mt ? b() : _ =
|
|
9770
|
+
if (N.VBR == T.vbr_mtrh || N.VBR == T.vbr_mt ? b() : _ = j.L3psycho_anal_ns(
|
|
9771
9771
|
N,
|
|
9772
9772
|
S,
|
|
9773
9773
|
E,
|
|
@@ -9787,7 +9787,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9787
9787
|
}
|
|
9788
9788
|
} else
|
|
9789
9789
|
b();
|
|
9790
|
-
if (m(f), ye.mdct_sub48(f, g[0], g[1]), f.mode_ext = i.MPG_MD_LR_LR, N.force_ms ? f.mode_ext = i.MPG_MD_MS_LR : N.mode == K.JOINT_STEREO && b(), f.mode_ext == o ? (
|
|
9790
|
+
if (m(f), ye.mdct_sub48(f, g[0], g[1]), f.mode_ext = i.MPG_MD_LR_LR, N.force_ms ? f.mode_ext = i.MPG_MD_MS_LR : N.mode == K.JOINT_STEREO && b(), f.mode_ext == o ? (q = R, $ = n) : (q = l, $ = B), N.analysis && f.pinfo != null && b(), N.VBR == T.vbr_off || N.VBR == T.vbr_abr) {
|
|
9791
9791
|
var J, D;
|
|
9792
9792
|
for (J = 0; J < 18; J++)
|
|
9793
9793
|
f.nsPsy.pefirbuf[J] = f.nsPsy.pefirbuf[J + 1];
|
|
@@ -9800,7 +9800,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9800
9800
|
for (c = 0; c < f.channels_out; c++)
|
|
9801
9801
|
$[v][c] *= D;
|
|
9802
9802
|
}
|
|
9803
|
-
return f.iteration_loop.iteration_loop(N, $, u,
|
|
9803
|
+
return f.iteration_loop.iteration_loop(N, $, u, q), A.format_bitstream(N), t = A.copy_buffer(f, Te, L, Y, 1), N.bWriteVbrTag && y.addVbrFrame(N), N.analysis && f.pinfo != null && b(), P(f), t;
|
|
9804
9804
|
};
|
|
9805
9805
|
}
|
|
9806
9806
|
function ie() {
|
|
@@ -9816,10 +9816,10 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9816
9816
|
this.l = H(i.SBMAX_l), this.s = he([i.SBMAX_s, 3]);
|
|
9817
9817
|
var o = this;
|
|
9818
9818
|
this.assign = function(A) {
|
|
9819
|
-
|
|
9820
|
-
for (var
|
|
9819
|
+
G.arraycopy(A.l, 0, o.l, 0, i.SBMAX_l);
|
|
9820
|
+
for (var j = 0; j < i.SBMAX_s; j++)
|
|
9821
9821
|
for (var y = 0; y < 3; y++)
|
|
9822
|
-
o.s[
|
|
9822
|
+
o.s[j][y] = A.s[j][y];
|
|
9823
9823
|
};
|
|
9824
9824
|
}
|
|
9825
9825
|
function Oe() {
|
|
@@ -9833,15 +9833,15 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9833
9833
|
this.write_timing = 0, this.ptr = 0, this.buf = le(o);
|
|
9834
9834
|
}
|
|
9835
9835
|
this.header = new Array(pe.MAX_HEADER_BUF), this.h_ptr = 0, this.w_ptr = 0, this.ancillary_flag = 0, this.ResvSize = 0, this.ResvMax = 0, this.scalefac_band = new k(), this.minval_l = H(i.CBANDS), this.minval_s = H(i.CBANDS), this.nb_1 = he([4, i.CBANDS]), this.nb_2 = he([4, i.CBANDS]), this.nb_s1 = he([4, i.CBANDS]), this.nb_s2 = he([4, i.CBANDS]), this.s3_ss = null, this.s3_ll = null, this.decay = 0, this.thm = new Array(4), this.en = new Array(4), this.tot_ener = H(4), this.loudness_sq = he([2, 2]), this.loudness_sq_save = H(2), this.mld_l = H(i.SBMAX_l), this.mld_s = H(i.SBMAX_s), this.bm_l = _e(i.SBMAX_l), this.bo_l = _e(i.SBMAX_l), this.bm_s = _e(i.SBMAX_s), this.bo_s = _e(i.SBMAX_s), this.npart_l = 0, this.npart_s = 0, this.s3ind = be([i.CBANDS, 2]), this.s3ind_s = be([i.CBANDS, 2]), this.numlines_s = _e(i.CBANDS), this.numlines_l = _e(i.CBANDS), this.rnumlines_l = H(i.CBANDS), this.mld_cb_l = H(i.CBANDS), this.mld_cb_s = H(i.CBANDS), this.numlines_s_num1 = 0, this.numlines_l_num1 = 0, this.pe = H(4), this.ms_ratio_s_old = 0, this.ms_ratio_l_old = 0, this.ms_ener_ratio_old = 0, this.blocktype_old = _e(2), this.nsPsy = new Oe(), this.VBR_seek_table = new ie(), this.ATH = null, this.PSY = null, this.nogap_total = 0, this.nogap_current = 0, this.decode_on_the_fly = !0, this.findReplayGain = !0, this.findPeakSample = !0, this.PeakSample = 0, this.RadioGain = 0, this.AudiophileGain = 0, this.rgdata = null, this.noclipGainChange = 0, this.noclipScale = 0, this.bitrate_stereoMode_Hist = be([16, 5]), this.bitrate_blockType_Hist = be([16, 6]), this.pinfo = null, this.hip = null, this.in_buffer_nsamples = 0, this.in_buffer_0 = null, this.in_buffer_1 = null, this.iteration_loop = null;
|
|
9836
|
-
for (var
|
|
9837
|
-
this.en[
|
|
9838
|
-
for (var
|
|
9839
|
-
this.thm[
|
|
9840
|
-
for (var
|
|
9841
|
-
this.header[
|
|
9842
|
-
}
|
|
9843
|
-
function
|
|
9844
|
-
var o = H(i.BLKSIZE), A = H(i.BLKSIZE_s / 2),
|
|
9836
|
+
for (var j = 0; j < this.en.length; j++)
|
|
9837
|
+
this.en[j] = new ke();
|
|
9838
|
+
for (var j = 0; j < this.thm.length; j++)
|
|
9839
|
+
this.thm[j] = new ke();
|
|
9840
|
+
for (var j = 0; j < this.header.length; j++)
|
|
9841
|
+
this.header[j] = new A();
|
|
9842
|
+
}
|
|
9843
|
+
function z() {
|
|
9844
|
+
var o = H(i.BLKSIZE), A = H(i.BLKSIZE_s / 2), j = [
|
|
9845
9845
|
0.9238795325112867,
|
|
9846
9846
|
0.3826834323650898,
|
|
9847
9847
|
0.9951847266721969,
|
|
@@ -9857,20 +9857,20 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
9857
9857
|
var L = P + fe;
|
|
9858
9858
|
ue = 4;
|
|
9859
9859
|
do {
|
|
9860
|
-
var Y, t, l, R,
|
|
9861
|
-
f = ue >> 1, R = ue,
|
|
9860
|
+
var Y, t, l, R, q, g, f;
|
|
9861
|
+
f = ue >> 1, R = ue, q = ue << 1, g = q + R, ue = q << 1, O = P, Te = O + f;
|
|
9862
9862
|
do {
|
|
9863
9863
|
var p, u, B, n;
|
|
9864
|
-
u = m[O + 0] - m[O + R], p = m[O + 0] + m[O + R], n = m[O +
|
|
9864
|
+
u = m[O + 0] - m[O + R], p = m[O + 0] + m[O + R], n = m[O + q] - m[O + g], B = m[O + q] + m[O + g], m[O + q] = p - B, m[O + 0] = p + B, m[O + g] = u - n, m[O + R] = u + n, u = m[Te + 0] - m[Te + R], p = m[Te + 0] + m[Te + R], n = I.SQRT2 * m[Te + g], B = I.SQRT2 * m[Te + q], m[Te + q] = p - B, m[Te + 0] = p + B, m[Te + g] = u - n, m[Te + R] = u + n, Te += ue, O += ue;
|
|
9865
9865
|
} while (O < L);
|
|
9866
|
-
for (t =
|
|
9866
|
+
for (t = j[N + 0], Y = j[N + 1], l = 1; l < f; l++) {
|
|
9867
9867
|
var $, c;
|
|
9868
9868
|
$ = 1 - 2 * Y * Y, c = 2 * Y * t, O = P + l, Te = P + R - l;
|
|
9869
9869
|
do {
|
|
9870
9870
|
var v, _, S, p, u, E, B, a, n, r;
|
|
9871
|
-
_ = c * m[O + R] - $ * m[Te + R], v = $ * m[O + R] + c * m[Te + R], u = m[O + 0] - v, p = m[O + 0] + v, E = m[Te + 0] - _, S = m[Te + 0] + _, _ = c * m[O + g] - $ * m[Te + g], v = $ * m[O + g] + c * m[Te + g], n = m[O +
|
|
9871
|
+
_ = c * m[O + R] - $ * m[Te + R], v = $ * m[O + R] + c * m[Te + R], u = m[O + 0] - v, p = m[O + 0] + v, E = m[Te + 0] - _, S = m[Te + 0] + _, _ = c * m[O + g] - $ * m[Te + g], v = $ * m[O + g] + c * m[Te + g], n = m[O + q] - v, B = m[O + q] + v, r = m[Te + q] - _, a = m[Te + q] + _, _ = Y * B - t * r, v = t * B + Y * r, m[O + q] = p - v, m[O + 0] = p + v, m[Te + g] = E - _, m[Te + R] = E + _, _ = t * a - Y * n, v = Y * a + t * n, m[Te + q] = S - v, m[Te + 0] = S + v, m[O + g] = u - _, m[O + R] = u + _, Te += ue, O += ue;
|
|
9872
9872
|
} while (O < L);
|
|
9873
|
-
$ = t, t = $ *
|
|
9873
|
+
$ = t, t = $ * j[N + 0] - Y * j[N + 1], Y = $ * j[N + 1] + Y * j[N + 0];
|
|
9874
9874
|
}
|
|
9875
9875
|
N += 2;
|
|
9876
9876
|
} while (ue < fe);
|
|
@@ -10009,16 +10009,16 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10009
10009
|
for (var O = 0; O < 3; O++) {
|
|
10010
10010
|
var Te = i.BLKSIZE_s / 2, L = 65535 & 576 / 3 * (O + 1), Y = i.BLKSIZE_s / 8 - 1;
|
|
10011
10011
|
do {
|
|
10012
|
-
var t, l, R,
|
|
10013
|
-
t = A[f] * N[fe][ue + f + L], g = A[127 - f] * N[fe][ue + f + L + 128], l = t - g, t = t + g, R = A[f + 64] * N[fe][ue + f + L + 64], g = A[63 - f] * N[fe][ue + f + L + 192],
|
|
10012
|
+
var t, l, R, q, g, f = ye[Y << 2] & 255;
|
|
10013
|
+
t = A[f] * N[fe][ue + f + L], g = A[127 - f] * N[fe][ue + f + L + 128], l = t - g, t = t + g, R = A[f + 64] * N[fe][ue + f + L + 64], g = A[63 - f] * N[fe][ue + f + L + 192], q = R - g, R = R + g, Te -= 4, P[O][Te + 0] = t + R, P[O][Te + 2] = t - R, P[O][Te + 1] = l + q, P[O][Te + 3] = l - q, t = A[f + 1] * N[fe][ue + f + L + 1], g = A[126 - f] * N[fe][ue + f + L + 129], l = t - g, t = t + g, R = A[f + 65] * N[fe][ue + f + L + 65], g = A[62 - f] * N[fe][ue + f + L + 193], q = R - g, R = R + g, P[O][Te + i.BLKSIZE_s / 2 + 0] = t + R, P[O][Te + i.BLKSIZE_s / 2 + 2] = t - R, P[O][Te + i.BLKSIZE_s / 2 + 1] = l + q, P[O][Te + i.BLKSIZE_s / 2 + 3] = l - q;
|
|
10014
10014
|
} while (--Y >= 0);
|
|
10015
10015
|
y(P[O], Te, i.BLKSIZE_s / 2);
|
|
10016
10016
|
}
|
|
10017
10017
|
}, this.fft_long = function(m, P, fe, N, ue) {
|
|
10018
10018
|
var O = i.BLKSIZE / 8 - 1, Te = i.BLKSIZE / 2;
|
|
10019
10019
|
do {
|
|
10020
|
-
var L, Y, t, l, R,
|
|
10021
|
-
L = o[
|
|
10020
|
+
var L, Y, t, l, R, q = ye[O] & 255;
|
|
10021
|
+
L = o[q] * N[fe][ue + q], R = o[q + 512] * N[fe][ue + q + 512], Y = L - R, L = L + R, t = o[q + 256] * N[fe][ue + q + 256], R = o[q + 768] * N[fe][ue + q + 768], l = t - R, t = t + R, Te -= 4, P[Te + 0] = L + t, P[Te + 2] = L - t, P[Te + 1] = Y + l, P[Te + 3] = Y - l, L = o[q + 1] * N[fe][ue + q + 1], R = o[q + 513] * N[fe][ue + q + 513], Y = L - R, L = L + R, t = o[q + 257] * N[fe][ue + q + 257], R = o[q + 769] * N[fe][ue + q + 769], l = t - R, t = t + R, P[Te + i.BLKSIZE / 2 + 0] = L + t, P[Te + i.BLKSIZE / 2 + 2] = L - t, P[Te + i.BLKSIZE / 2 + 1] = Y + l, P[Te + i.BLKSIZE / 2 + 3] = Y - l;
|
|
10022
10022
|
} while (--O >= 0);
|
|
10023
10023
|
y(P, Te, i.BLKSIZE / 2);
|
|
10024
10024
|
}, this.init_fft = function(m) {
|
|
@@ -10029,7 +10029,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10029
10029
|
};
|
|
10030
10030
|
}
|
|
10031
10031
|
function me() {
|
|
10032
|
-
var o = new
|
|
10032
|
+
var o = new z(), A = 2.302585092994046, j = 2, y = 16, ye = 2, m = 16, P = 0.34, fe = 1 / (14752 * 14752) / (i.BLKSIZE / 2), N = 0.01, ue = 0.8, O = 0.6, Te = 0.3, L = 3.5, Y = 21, t = 0.2302585093;
|
|
10033
10033
|
function l(ce, U) {
|
|
10034
10034
|
for (var ne = 0, je = 0; je < i.BLKSIZE / 2; ++je)
|
|
10035
10035
|
ne += ce[je] * U.ATH.eql_w[je];
|
|
@@ -10059,7 +10059,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10059
10059
|
}
|
|
10060
10060
|
ce.analysis && b(), ce.athaa_loudapprox == 2 && We < 2 && (gt.loudness_sq[qe][We] = gt.loudness_sq_save[We], gt.loudness_sq_save[We] = l(U, gt));
|
|
10061
10061
|
}
|
|
10062
|
-
var
|
|
10062
|
+
var q = 8, g = 23, f = 15, p, u, B, n = [
|
|
10063
10063
|
1,
|
|
10064
10064
|
0.79433,
|
|
10065
10065
|
0.63096,
|
|
@@ -10071,7 +10071,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10071
10071
|
0.11749
|
|
10072
10072
|
];
|
|
10073
10073
|
function $() {
|
|
10074
|
-
p = Math.pow(10, (
|
|
10074
|
+
p = Math.pow(10, (q + 1) / 16), u = Math.pow(10, (g + 1) / 16), B = Math.pow(10, f / 10);
|
|
10075
10075
|
}
|
|
10076
10076
|
var c = [
|
|
10077
10077
|
3.3246 * 3.3246,
|
|
@@ -10413,7 +10413,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10413
10413
|
$e
|
|
10414
10414
|
);
|
|
10415
10415
|
Zt *= 0.158489319246111, $e.blocktype_old[Ze & 1] == i.SHORT_TYPE ? vt[lt] = Zt : vt[lt] = D(
|
|
10416
|
-
Math.min(Zt, Math.min(
|
|
10416
|
+
Math.min(Zt, Math.min(j * $e.nb_1[Ze][lt], y * $e.nb_2[Ze][lt])),
|
|
10417
10417
|
Zt,
|
|
10418
10418
|
Yt
|
|
10419
10419
|
), $e.nb_2[Ze][lt] = $e.nb_1[Ze][lt], $e.nb_1[Ze][lt] = Zt;
|
|
@@ -10660,8 +10660,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10660
10660
|
function oe() {
|
|
10661
10661
|
var o = this, A = 128 * 1024;
|
|
10662
10662
|
oe.V9 = 410, oe.V8 = 420, oe.V7 = 430, oe.V6 = 440, oe.V5 = 450, oe.V4 = 460, oe.V3 = 470, oe.V2 = 480, oe.V1 = 490, oe.V0 = 500, oe.R3MIX = 1e3, oe.STANDARD = 1001, oe.EXTREME = 1002, oe.INSANE = 1003, oe.STANDARD_FAST = 1004, oe.EXTREME_FAST = 1005, oe.MEDIUM = 1006, oe.MEDIUM_FAST = 1007;
|
|
10663
|
-
var
|
|
10664
|
-
oe.LAME_MAXMP3BUFFER =
|
|
10663
|
+
var j = 16384 + A;
|
|
10664
|
+
oe.LAME_MAXMP3BUFFER = j;
|
|
10665
10665
|
var y, ye, m, P, fe, N = new me(), ue, O;
|
|
10666
10666
|
this.enc = new i(), this.setModules = function(a, r, J, D, Z, xe, De, Ne, Qe) {
|
|
10667
10667
|
y = a, ye = r, m = J, P = D, fe = Z, ue = xe, O = Ne, this.enc.setModules(ye, N, P, ue);
|
|
@@ -10715,7 +10715,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10715
10715
|
}
|
|
10716
10716
|
return xe - a > a - D ? J : Z;
|
|
10717
10717
|
};
|
|
10718
|
-
function
|
|
10718
|
+
function q(a, r) {
|
|
10719
10719
|
switch (a) {
|
|
10720
10720
|
case 44100:
|
|
10721
10721
|
return r.version = 1, 0;
|
|
@@ -10895,7 +10895,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
10895
10895
|
a.compression_ratio = a.out_samplerate * 16 * r.channels_out / (1e3 * a.brate);
|
|
10896
10896
|
break;
|
|
10897
10897
|
}
|
|
10898
|
-
a.mode == K.NOT_SET && (a.mode = K.JOINT_STEREO), a.highpassfreq > 0 ? b() : (r.highpass1 = 0, r.highpass2 = 0), a.lowpassfreq > 0 ? (r.lowpass2 = 2 * a.lowpassfreq, a.lowpasswidth >= 0 ? b() : r.lowpass1 = 1 * 2 * a.lowpassfreq, r.lowpass1 /= a.out_samplerate, r.lowpass2 /= a.out_samplerate) : b(), u(a), r.samplerate_index =
|
|
10898
|
+
a.mode == K.NOT_SET && (a.mode = K.JOINT_STEREO), a.highpassfreq > 0 ? b() : (r.highpass1 = 0, r.highpass2 = 0), a.lowpassfreq > 0 ? (r.lowpass2 = 2 * a.lowpassfreq, a.lowpasswidth >= 0 ? b() : r.lowpass1 = 1 * 2 * a.lowpassfreq, r.lowpass1 /= a.out_samplerate, r.lowpass2 /= a.out_samplerate) : b(), u(a), r.samplerate_index = q(a.out_samplerate, a), r.samplerate_index < 0 && b(), a.VBR == T.vbr_off ? a.free_format ? r.bitrate_index = 0 : (a.brate = g(
|
|
10899
10899
|
a.brate,
|
|
10900
10900
|
a.version,
|
|
10901
10901
|
a.out_samplerate
|
|
@@ -11079,7 +11079,7 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
11079
11079
|
};
|
|
11080
11080
|
}
|
|
11081
11081
|
function Se() {
|
|
11082
|
-
this.setModules = function(o, A,
|
|
11082
|
+
this.setModules = function(o, A, j) {
|
|
11083
11083
|
};
|
|
11084
11084
|
}
|
|
11085
11085
|
function Fe() {
|
|
@@ -11088,19 +11088,19 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
11088
11088
|
this.setModules = function(o, A) {
|
|
11089
11089
|
};
|
|
11090
11090
|
}
|
|
11091
|
-
function se(o, A,
|
|
11091
|
+
function se(o, A, j) {
|
|
11092
11092
|
o != 1 && b("fix cc: only supports mono");
|
|
11093
11093
|
var y = new oe(), ye = new X(), m = new te(), P = new Je(), fe = new Ce(), N = new e(), ue = new C(), O = new Pe(), Te = new ve(), L = new V(), Y = new Ue(), t = new re(), l = new Se(), R = new Fe();
|
|
11094
11094
|
y.setModules(m, P, fe, N, ue, O, Te, L, R), P.setModules(m, R, Te, O), L.setModules(P, Te), fe.setModules(y), ue.setModules(P, Y, N, t), N.setModules(t, Y, y.enc.psy), Y.setModules(P), t.setModules(N), O.setModules(y, P, Te), ye.setModules(l, R), l.setModules(Te, L, fe);
|
|
11095
|
-
var
|
|
11096
|
-
|
|
11095
|
+
var q = y.lame_init();
|
|
11096
|
+
q.num_channels = o, q.in_samplerate = A, q.out_samplerate = A, q.brate = j, q.mode = K.STEREO, q.quality = 3, q.bWriteVbrTag = !1, q.disable_reservoir = !0, q.write_id3tag_automatic = !1, y.lame_init_params(q);
|
|
11097
11097
|
var g = 1152, f = 0 | 1.25 * g + 7200, p = le(f);
|
|
11098
11098
|
this.encodeBuffer = function(u, B) {
|
|
11099
11099
|
o == 1 && (B = u), u.length > g && (g = u.length, f = 0 | 1.25 * g + 7200, p = le(f));
|
|
11100
|
-
var n = y.lame_encode_buffer(
|
|
11100
|
+
var n = y.lame_encode_buffer(q, u, B, u.length, p, 0, f);
|
|
11101
11101
|
return new Int8Array(p.subarray(0, n));
|
|
11102
11102
|
}, this.flush = function() {
|
|
11103
|
-
var u = y.lame_encode_flush(
|
|
11103
|
+
var u = y.lame_encode_flush(q, p, 0, f);
|
|
11104
11104
|
return new Int8Array(p.subarray(0, u));
|
|
11105
11105
|
};
|
|
11106
11106
|
}
|
|
@@ -11151,10 +11151,10 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
11151
11151
|
throw new Error(ae.G("NonBrowser-1", [F]));
|
|
11152
11152
|
var ge = H.elem;
|
|
11153
11153
|
ge && (typeof ge == "string" ? ge = document.querySelector(ge) : ge.length && (ge = ge[0])), ge && (H.width = ge.offsetWidth, H.height = ge.offsetHeight);
|
|
11154
|
-
var
|
|
11155
|
-
|
|
11156
|
-
var Le = we.canvas =
|
|
11157
|
-
ge && (ge.innerHTML = "", ge.appendChild(
|
|
11154
|
+
var G = we.elem = document.createElement("div");
|
|
11155
|
+
G.style.fontSize = 0, G.innerHTML = '<canvas style="width:100%;height:100%;"/>';
|
|
11156
|
+
var Le = we.canvas = G.querySelector("canvas");
|
|
11157
|
+
ge && (ge.innerHTML = "", ge.appendChild(G));
|
|
11158
11158
|
}
|
|
11159
11159
|
var I = H.scale, ee = H.width * I, Ae = H.height * I;
|
|
11160
11160
|
if (!ee || !Ae)
|
|
@@ -11170,8 +11170,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
11170
11170
|
return Ee;
|
|
11171
11171
|
},
|
|
11172
11172
|
genPath: function(H, we, he) {
|
|
11173
|
-
for (var be = [], Ee = this, Le = Ee.set, ge = Le.scale,
|
|
11174
|
-
var Ae = (1 + Math.cos(Math.PI + ee /
|
|
11173
|
+
for (var be = [], Ee = this, Le = Ee.set, ge = Le.scale, G = Le.width * ge, I = Le.height * ge / 2, ee = 0; ee <= G; ee += ge) {
|
|
11174
|
+
var Ae = (1 + Math.cos(Math.PI + ee / G * 2 * Math.PI)) / 2, T = Ae * I * we * Math.sin(2 * Math.PI * (ee / G) * H + he) + I;
|
|
11175
11175
|
be.push(T);
|
|
11176
11176
|
}
|
|
11177
11177
|
return be;
|
|
@@ -11188,13 +11188,13 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
11188
11188
|
var be = Date.now(), Ee = H.drawTime || 0;
|
|
11189
11189
|
if (!(be - Ee < he)) {
|
|
11190
11190
|
H.drawTime = be;
|
|
11191
|
-
for (var Le = H.sampleRate / we.fps, ge = H.pcmData,
|
|
11192
|
-
ee += Math.abs(ge[
|
|
11193
|
-
H.pcmPos =
|
|
11191
|
+
for (var Le = H.sampleRate / we.fps, ge = H.pcmData, G = H.pcmPos, I = Math.max(0, Math.min(Le, ge.length - G)), ee = 0, Ae = 0; Ae < I; Ae++, G++)
|
|
11192
|
+
ee += Math.abs(ge[G]);
|
|
11193
|
+
H.pcmPos = G, (I || !we.keep) && H.draw(w.PowerLevel(ee, I)), !I && be - H.inputTime > 1300 && (clearInterval(H.timer), H.timer = 0);
|
|
11194
11194
|
}
|
|
11195
11195
|
},
|
|
11196
11196
|
draw: function(H) {
|
|
11197
|
-
var we = this, he = we.set, be = we.ctx, Ee = he.scale, Le = he.width * Ee, ge = he.height * Ee,
|
|
11197
|
+
var we = this, he = we.set, be = we.ctx, Ee = he.scale, Le = he.width * Ee, ge = he.height * Ee, G = he.speed / he.fps, I = we._phase -= G, ee = I + G * he.phase, Ae = H / 100, T = we.genPath(2, Ae, I), K = we.genPath(1.8, Ae, ee);
|
|
11198
11198
|
be.clearRect(0, 0, Le, ge), be.beginPath();
|
|
11199
11199
|
for (var ve = 0, re = 0; re <= Le; ve++, re += Ee)
|
|
11200
11200
|
re == 0 ? be.moveTo(re, T[ve]) : be.lineTo(re, T[ve]);
|
|
@@ -11206,8 +11206,8 @@ const L0 = /* @__PURE__ */ Y0(on);
|
|
|
11206
11206
|
drawPath: function(H, we) {
|
|
11207
11207
|
var he = this, be = he.set, Ee = he.ctx, Le = be.scale, ge = be.width * Le;
|
|
11208
11208
|
Ee.beginPath();
|
|
11209
|
-
for (var
|
|
11210
|
-
I == 0 ? Ee.moveTo(I, H[
|
|
11209
|
+
for (var G = 0, I = 0; I <= ge; G++, I += Le)
|
|
11210
|
+
I == 0 ? Ee.moveTo(I, H[G]) : Ee.lineTo(I, H[G]);
|
|
11211
11211
|
Ee.lineWidth = be.lineWidth * Le, Ee.strokeStyle = we, Ee.stroke();
|
|
11212
11212
|
}
|
|
11213
11213
|
}, w[F] = le;
|
|
@@ -11243,7 +11243,7 @@ const ga = (w) => (ka("data-v-e59bd63b"), w = w(), Aa(), w), ln = {
|
|
|
11243
11243
|
bitRate: 16,
|
|
11244
11244
|
//mp3格式,指定采样率hz、比特率kbps,其他参数使用默认配置;注意:是数字的参数必须提供数字,不要用字符串;需要使用的type类型,需提前把格式支持文件加载进来,比如使用wav格式需要提前加载wav.js编码引擎
|
|
11245
11245
|
onProcess: (re, te, Ce, Ue) => {
|
|
11246
|
-
be.value =
|
|
11246
|
+
be.value = G(Ce), F.value && F.value.input(
|
|
11247
11247
|
re[re.length - 1],
|
|
11248
11248
|
te,
|
|
11249
11249
|
Ue
|
|
@@ -11263,7 +11263,7 @@ const ga = (w) => (ka("data-v-e59bd63b"), w = w(), Aa(), w), ln = {
|
|
|
11263
11263
|
f0(() => {
|
|
11264
11264
|
le.value.close(), le.value = null, Le.value = "";
|
|
11265
11265
|
}), ge();
|
|
11266
|
-
function
|
|
11266
|
+
function G(re) {
|
|
11267
11267
|
const te = Math.floor(re / 1e3), Ce = Math.floor(te / 60), Ue = te % 60, Pe = Ce.toString().padStart(2, "0"), Je = Ue.toString().padStart(2, "0");
|
|
11268
11268
|
return `${Pe}:${Je}`;
|
|
11269
11269
|
}
|
|
@@ -11273,7 +11273,7 @@ const ga = (w) => (ka("data-v-e59bd63b"), w = w(), Aa(), w), ln = {
|
|
|
11273
11273
|
function ee() {
|
|
11274
11274
|
le.value.stop(
|
|
11275
11275
|
(re, te) => {
|
|
11276
|
-
H.value = !1, we.value = window.URL.createObjectURL(re), be.value =
|
|
11276
|
+
H.value = !1, we.value = window.URL.createObjectURL(re), be.value = G(te), he.value = re, bt.isMobile && Ae();
|
|
11277
11277
|
},
|
|
11278
11278
|
(re) => {
|
|
11279
11279
|
console.log("录音失败:" + re), H.value = !1, we.value = null, he.value = null, be.value = "00:00";
|
|
@@ -11428,7 +11428,7 @@ var xa = { exports: {} };
|
|
|
11428
11428
|
}, e = new ae(k, e);
|
|
11429
11429
|
var s = this;
|
|
11430
11430
|
function d(X) {
|
|
11431
|
-
return e.disableLogs || console.log("RecordRTC version: ", s.version), X && (e = new ae(k, X)), e.disableLogs || console.log("started recording " + e.type + " stream."),
|
|
11431
|
+
return e.disableLogs || console.log("RecordRTC version: ", s.version), X && (e = new ae(k, X)), e.disableLogs || console.log("started recording " + e.type + " stream."), z ? (z.clearRecordedData(), z.record(), ke("recording"), s.recordingDuration && de(), s) : (h(function() {
|
|
11432
11432
|
s.recordingDuration && de();
|
|
11433
11433
|
}), s);
|
|
11434
11434
|
}
|
|
@@ -11437,11 +11437,11 @@ var xa = { exports: {} };
|
|
|
11437
11437
|
X(), X = e.initCallback = null;
|
|
11438
11438
|
});
|
|
11439
11439
|
var Se = new b(k, e);
|
|
11440
|
-
|
|
11440
|
+
z = new Se(k, e), z.record(), ke("recording"), e.disableLogs || console.log("Initialized recorderType:", z.constructor.name, "for output-type:", e.type);
|
|
11441
11441
|
}
|
|
11442
11442
|
function C(X) {
|
|
11443
11443
|
if (X = X || function() {
|
|
11444
|
-
}, !
|
|
11444
|
+
}, !z) {
|
|
11445
11445
|
pe();
|
|
11446
11446
|
return;
|
|
11447
11447
|
}
|
|
@@ -11451,19 +11451,19 @@ var xa = { exports: {} };
|
|
|
11451
11451
|
}, 1);
|
|
11452
11452
|
return;
|
|
11453
11453
|
}
|
|
11454
|
-
s.state !== "recording" && !e.disableLogs && console.warn('Recording state should be: "recording", however current state is: ', s.state), e.disableLogs || console.log("Stopped recording " + e.type + " stream."), e.type !== "gif" ?
|
|
11454
|
+
s.state !== "recording" && !e.disableLogs && console.warn('Recording state should be: "recording", however current state is: ', s.state), e.disableLogs || console.log("Stopped recording " + e.type + " stream."), e.type !== "gif" ? z.stop(Se) : (z.stop(), Se()), ke("stopped");
|
|
11455
11455
|
function Se(Fe) {
|
|
11456
|
-
if (!
|
|
11456
|
+
if (!z) {
|
|
11457
11457
|
typeof X.call == "function" ? X.call(s, "") : X("");
|
|
11458
11458
|
return;
|
|
11459
11459
|
}
|
|
11460
|
-
Object.keys(
|
|
11461
|
-
typeof
|
|
11460
|
+
Object.keys(z).forEach(function(o) {
|
|
11461
|
+
typeof z[o] != "function" && (s[o] = z[o]);
|
|
11462
11462
|
});
|
|
11463
|
-
var V =
|
|
11463
|
+
var V = z.blob;
|
|
11464
11464
|
if (!V)
|
|
11465
11465
|
if (Fe)
|
|
11466
|
-
|
|
11466
|
+
z.blob = V = Fe;
|
|
11467
11467
|
else
|
|
11468
11468
|
throw "Recording failed.";
|
|
11469
11469
|
if (V && !e.disableLogs && console.log(V.type, "->", Ae(V.size)), X) {
|
|
@@ -11481,7 +11481,7 @@ var xa = { exports: {} };
|
|
|
11481
11481
|
}
|
|
11482
11482
|
}
|
|
11483
11483
|
function W() {
|
|
11484
|
-
if (!
|
|
11484
|
+
if (!z) {
|
|
11485
11485
|
pe();
|
|
11486
11486
|
return;
|
|
11487
11487
|
}
|
|
@@ -11489,10 +11489,10 @@ var xa = { exports: {} };
|
|
|
11489
11489
|
e.disableLogs || console.warn("Unable to pause the recording. Recording state: ", s.state);
|
|
11490
11490
|
return;
|
|
11491
11491
|
}
|
|
11492
|
-
ke("paused"),
|
|
11492
|
+
ke("paused"), z.pause(), e.disableLogs || console.log("Paused recording.");
|
|
11493
11493
|
}
|
|
11494
11494
|
function x() {
|
|
11495
|
-
if (!
|
|
11495
|
+
if (!z) {
|
|
11496
11496
|
pe();
|
|
11497
11497
|
return;
|
|
11498
11498
|
}
|
|
@@ -11500,7 +11500,7 @@ var xa = { exports: {} };
|
|
|
11500
11500
|
e.disableLogs || console.warn("Unable to resume the recording. Recording state: ", s.state);
|
|
11501
11501
|
return;
|
|
11502
11502
|
}
|
|
11503
|
-
ke("recording"),
|
|
11503
|
+
ke("recording"), z.resume(), e.disableLogs || console.log("Resumed recording.");
|
|
11504
11504
|
}
|
|
11505
11505
|
function i(X) {
|
|
11506
11506
|
postMessage(new FileReaderSync().readAsDataURL(X));
|
|
@@ -11508,7 +11508,7 @@ var xa = { exports: {} };
|
|
|
11508
11508
|
function ie(X, Se) {
|
|
11509
11509
|
if (!X)
|
|
11510
11510
|
throw "Pass a callback function over getDataURL.";
|
|
11511
|
-
var Fe = Se ? Se.blob : (
|
|
11511
|
+
var Fe = Se ? Se.blob : (z || {}).blob;
|
|
11512
11512
|
if (!Fe) {
|
|
11513
11513
|
e.disableLogs || console.warn("Blob encoder did not finish its job yet."), setTimeout(function() {
|
|
11514
11514
|
ie(X, Se);
|
|
@@ -11528,13 +11528,13 @@ var xa = { exports: {} };
|
|
|
11528
11528
|
}
|
|
11529
11529
|
function o(A) {
|
|
11530
11530
|
try {
|
|
11531
|
-
var
|
|
11531
|
+
var j = be.createObjectURL(new Blob([
|
|
11532
11532
|
A.toString(),
|
|
11533
11533
|
"this.onmessage = function (eee) {" + A.name + "(eee.data);}"
|
|
11534
11534
|
], {
|
|
11535
11535
|
type: "application/javascript"
|
|
11536
|
-
})), y = new Worker(
|
|
11537
|
-
return be.revokeObjectURL(
|
|
11536
|
+
})), y = new Worker(j);
|
|
11537
|
+
return be.revokeObjectURL(j), y;
|
|
11538
11538
|
} catch {
|
|
11539
11539
|
}
|
|
11540
11540
|
}
|
|
@@ -11563,7 +11563,7 @@ var xa = { exports: {} };
|
|
|
11563
11563
|
function pe() {
|
|
11564
11564
|
e.disableLogs !== !0 && console.warn(Oe);
|
|
11565
11565
|
}
|
|
11566
|
-
var
|
|
11566
|
+
var z, me = {
|
|
11567
11567
|
/**
|
|
11568
11568
|
* This method starts the recording.
|
|
11569
11569
|
* @method
|
|
@@ -11661,11 +11661,11 @@ var xa = { exports: {} };
|
|
|
11661
11661
|
* recorder.clearRecordedData();
|
|
11662
11662
|
*/
|
|
11663
11663
|
clearRecordedData: function() {
|
|
11664
|
-
if (!
|
|
11664
|
+
if (!z) {
|
|
11665
11665
|
pe();
|
|
11666
11666
|
return;
|
|
11667
11667
|
}
|
|
11668
|
-
|
|
11668
|
+
z.clearRecordedData(), e.disableLogs || console.log("Cleared old recorded data.");
|
|
11669
11669
|
},
|
|
11670
11670
|
/**
|
|
11671
11671
|
* Get the recorded blob. Use this method inside the "stopRecording" callback.
|
|
@@ -11687,11 +11687,11 @@ var xa = { exports: {} };
|
|
|
11687
11687
|
* @returns {Blob} Returns recorded data as "Blob" object.
|
|
11688
11688
|
*/
|
|
11689
11689
|
getBlob: function() {
|
|
11690
|
-
if (!
|
|
11690
|
+
if (!z) {
|
|
11691
11691
|
pe();
|
|
11692
11692
|
return;
|
|
11693
11693
|
}
|
|
11694
|
-
return
|
|
11694
|
+
return z.blob;
|
|
11695
11695
|
},
|
|
11696
11696
|
/**
|
|
11697
11697
|
* Get data-URI instead of Blob.
|
|
@@ -11719,11 +11719,11 @@ var xa = { exports: {} };
|
|
|
11719
11719
|
* @returns {String} Returns a virtual/temporary URL for the recorded "Blob".
|
|
11720
11720
|
*/
|
|
11721
11721
|
toURL: function() {
|
|
11722
|
-
if (!
|
|
11722
|
+
if (!z) {
|
|
11723
11723
|
pe();
|
|
11724
11724
|
return;
|
|
11725
11725
|
}
|
|
11726
|
-
return be.createObjectURL(
|
|
11726
|
+
return be.createObjectURL(z.blob);
|
|
11727
11727
|
},
|
|
11728
11728
|
/**
|
|
11729
11729
|
* Get internal recording object (i.e. internal module) e.g. MutliStreamRecorder, MediaStreamRecorder, StereoAudioRecorder or WhammyRecorder etc.
|
|
@@ -11739,7 +11739,7 @@ var xa = { exports: {} };
|
|
|
11739
11739
|
* @returns {Object} Returns internal recording object.
|
|
11740
11740
|
*/
|
|
11741
11741
|
getInternalRecorder: function() {
|
|
11742
|
-
return
|
|
11742
|
+
return z;
|
|
11743
11743
|
},
|
|
11744
11744
|
/**
|
|
11745
11745
|
* Invoke save-as dialog to save the recorded blob into your disk.
|
|
@@ -11756,11 +11756,11 @@ var xa = { exports: {} };
|
|
|
11756
11756
|
* });
|
|
11757
11757
|
*/
|
|
11758
11758
|
save: function(X) {
|
|
11759
|
-
if (!
|
|
11759
|
+
if (!z) {
|
|
11760
11760
|
pe();
|
|
11761
11761
|
return;
|
|
11762
11762
|
}
|
|
11763
|
-
T(
|
|
11763
|
+
T(z.blob, X);
|
|
11764
11764
|
},
|
|
11765
11765
|
/**
|
|
11766
11766
|
* This method gets a blob from indexed-DB storage.
|
|
@@ -11774,7 +11774,7 @@ var xa = { exports: {} };
|
|
|
11774
11774
|
* });
|
|
11775
11775
|
*/
|
|
11776
11776
|
getFromDisk: function(X) {
|
|
11777
|
-
if (!
|
|
11777
|
+
if (!z) {
|
|
11778
11778
|
pe();
|
|
11779
11779
|
return;
|
|
11780
11780
|
}
|
|
@@ -11866,7 +11866,7 @@ var xa = { exports: {} };
|
|
|
11866
11866
|
* recorder.startRecording();
|
|
11867
11867
|
*/
|
|
11868
11868
|
reset: function() {
|
|
11869
|
-
s.state === "recording" && !e.disableLogs && console.warn("Stop an active recorder."),
|
|
11869
|
+
s.state === "recording" && !e.disableLogs && console.warn("Stop an active recorder."), z && typeof z.clearRecordedData == "function" && z.clearRecordedData(), z = null, ke("inactive"), s.blob = null;
|
|
11870
11870
|
},
|
|
11871
11871
|
/**
|
|
11872
11872
|
* This method is called whenever recorder's state changes. Use this as an "event".
|
|
@@ -12023,7 +12023,7 @@ var xa = { exports: {} };
|
|
|
12023
12023
|
*/
|
|
12024
12024
|
function b(k, e) {
|
|
12025
12025
|
var s;
|
|
12026
|
-
return (
|
|
12026
|
+
return (G || Ee || Le) && (s = Je), typeof MediaRecorder < "u" && "requestData" in MediaRecorder.prototype && !G && (s = Pe), e.type === "video" && (G || Le) && (s = M, typeof He < "u" && typeof ReadableStream < "u" && (s = He)), e.type === "gif" && (s = Me), e.type === "canvas" && (s = Ie), Ue() && s !== Ie && s !== Me && typeof MediaRecorder < "u" && "requestData" in MediaRecorder.prototype && (ve(k, "video").length || ve(k, "audio").length) && (e.type === "audio" ? typeof MediaRecorder.isTypeSupported == "function" && MediaRecorder.isTypeSupported("audio/webm") && (s = Pe) : typeof MediaRecorder.isTypeSupported == "function" && MediaRecorder.isTypeSupported("video/webm") && (s = Pe)), k instanceof Array && k.length && (s = tt), e.recorderType && (s = e.recorderType), !e.disableLogs && s && s.name && console.log("Using recorderType:", s.name || s.constructor.name), !s && I && (s = Pe), s;
|
|
12027
12027
|
}
|
|
12028
12028
|
/**
|
|
12029
12029
|
* MRecordRTC runs on top of {@link RecordRTC} to bring multiple recordings in a single place, by providing simple API.
|
|
@@ -12273,8 +12273,8 @@ var xa = { exports: {} };
|
|
|
12273
12273
|
typeof he > "u" && (typeof webkitAudioContext < "u" && (he = webkitAudioContext), typeof mozAudioContext < "u" && (he = mozAudioContext));
|
|
12274
12274
|
var be = window.URL;
|
|
12275
12275
|
typeof be > "u" && typeof webkitURL < "u" && (be = webkitURL), typeof navigator < "u" && typeof navigator.getUserMedia > "u" && (typeof navigator.webkitGetUserMedia < "u" && (navigator.getUserMedia = navigator.webkitGetUserMedia), typeof navigator.mozGetUserMedia < "u" && (navigator.getUserMedia = navigator.mozGetUserMedia));
|
|
12276
|
-
var Ee = navigator.userAgent.indexOf("Edge") !== -1 && (!!navigator.msSaveBlob || !!navigator.msSaveOrOpenBlob), Le = !!window.opera || navigator.userAgent.indexOf("OPR/") !== -1, ge = navigator.userAgent.toLowerCase().indexOf("firefox") > -1 && "netscape" in window && / rv:/.test(navigator.userAgent),
|
|
12277
|
-
I && !
|
|
12276
|
+
var Ee = navigator.userAgent.indexOf("Edge") !== -1 && (!!navigator.msSaveBlob || !!navigator.msSaveOrOpenBlob), Le = !!window.opera || navigator.userAgent.indexOf("OPR/") !== -1, ge = navigator.userAgent.toLowerCase().indexOf("firefox") > -1 && "netscape" in window && / rv:/.test(navigator.userAgent), G = !Le && !Ee && !!navigator.webkitGetUserMedia || K() || navigator.userAgent.toLowerCase().indexOf("chrome/") !== -1, I = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
12277
|
+
I && !G && navigator.userAgent.indexOf("CriOS") !== -1 && (I = !1, G = !0);
|
|
12278
12278
|
var ee = window.MediaStream;
|
|
12279
12279
|
typeof ee > "u" && typeof webkitMediaStream < "u" && (ee = webkitMediaStream), typeof ee < "u" && typeof ee.prototype.stop > "u" && (ee.prototype.stop = function() {
|
|
12280
12280
|
this.getTracks().forEach(function(k) {
|
|
@@ -12355,7 +12355,7 @@ var xa = { exports: {} };
|
|
|
12355
12355
|
if (ge || I || Ee)
|
|
12356
12356
|
return !0;
|
|
12357
12357
|
var k = navigator.userAgent, e = "" + parseFloat(navigator.appVersion), s = parseInt(navigator.appVersion, 10), d, h;
|
|
12358
|
-
return (
|
|
12358
|
+
return (G || Le) && (d = k.indexOf("Chrome"), e = k.substring(d + 7)), (h = e.indexOf(";")) !== -1 && (e = e.substring(0, h)), (h = e.indexOf(" ")) !== -1 && (e = e.substring(0, h)), s = parseInt("" + e, 10), isNaN(s) && (e = "" + parseFloat(navigator.appVersion), s = parseInt(navigator.appVersion, 10)), s >= 49;
|
|
12359
12359
|
}
|
|
12360
12360
|
/**
|
|
12361
12361
|
* MediaStreamRecorder is an abstraction layer for {@link https://w3c.github.io/mediacapture-record/MediaRecorder.html|MediaRecorder API}. It is used by {@link RecordRTC} to record MediaStream(s) in both Chrome and Firefox.
|
|
@@ -12401,7 +12401,7 @@ var xa = { exports: {} };
|
|
|
12401
12401
|
var s;
|
|
12402
12402
|
navigator.mozGetUserMedia ? (s = new ee(), s.addTrack(ve(k, "audio")[0])) : s = new ee(ve(k, "audio")), k = s;
|
|
12403
12403
|
}
|
|
12404
|
-
(!e.mimeType || e.mimeType.toString().toLowerCase().indexOf("audio") === -1) && (e.mimeType =
|
|
12404
|
+
(!e.mimeType || e.mimeType.toString().toLowerCase().indexOf("audio") === -1) && (e.mimeType = G ? "audio/webm" : "audio/ogg"), e.mimeType && e.mimeType.toString().toLowerCase() !== "audio/ogg" && navigator.mozGetUserMedia && (e.mimeType = "audio/ogg");
|
|
12405
12405
|
}
|
|
12406
12406
|
var d = [];
|
|
12407
12407
|
this.getArrayOfBlobs = function() {
|
|
@@ -12409,7 +12409,7 @@ var xa = { exports: {} };
|
|
|
12409
12409
|
}, this.record = function() {
|
|
12410
12410
|
de.blob = null, de.clearRecordedData(), de.timestamps = [], ie = [], d = [];
|
|
12411
12411
|
var ke = e;
|
|
12412
|
-
e.disableLogs || console.log("Passing following config over MediaRecorder API.", ke), x && (x = null),
|
|
12412
|
+
e.disableLogs || console.log("Passing following config over MediaRecorder API.", ke), x && (x = null), G && !Ue() && (ke = "video/vp8"), typeof MediaRecorder.isTypeSupported == "function" && ke.mimeType && (MediaRecorder.isTypeSupported(ke.mimeType) || (e.disableLogs || console.warn("MediaRecorder API seems unable to record mimeType:", ke.mimeType), ke.mimeType = e.type === "audio" ? "audio/webm" : "video/webm"));
|
|
12413
12413
|
try {
|
|
12414
12414
|
x = new MediaRecorder(k, ke), e.mimeType = ke.mimeType;
|
|
12415
12415
|
} catch {
|
|
@@ -12547,12 +12547,12 @@ var xa = { exports: {} };
|
|
|
12547
12547
|
this.record = function() {
|
|
12548
12548
|
if (de() === !1)
|
|
12549
12549
|
throw "Please make sure MediaStream is active.";
|
|
12550
|
-
Fe(), se = Se = !1, C = !0, typeof e.timeSlice < "u" &&
|
|
12550
|
+
Fe(), se = Se = !1, C = !0, typeof e.timeSlice < "u" && j();
|
|
12551
12551
|
};
|
|
12552
12552
|
function ke(y, ye) {
|
|
12553
12553
|
function m(fe, N) {
|
|
12554
12554
|
var ue = fe.numberOfAudioChannels, O = fe.leftBuffers.slice(0), Te = fe.rightBuffers.slice(0), L = fe.sampleRate, Y = fe.internalInterleavedLength, t = fe.desiredSampRate;
|
|
12555
|
-
ue === 2 && (O =
|
|
12555
|
+
ue === 2 && (O = q(O, Y), Te = q(Te, Y), t && (O = l(O, t, L), Te = l(Te, t, L))), ue === 1 && (O = q(O, Y), t && (O = l(O, t, L))), t && (L = t);
|
|
12556
12556
|
function l(E, a, r) {
|
|
12557
12557
|
var J = Math.round(E.length * (a / r)), D = [], Z = Number((E.length - 1) / (J - 1));
|
|
12558
12558
|
D[0] = E[0];
|
|
@@ -12565,7 +12565,7 @@ var xa = { exports: {} };
|
|
|
12565
12565
|
function R(E, a, r) {
|
|
12566
12566
|
return E + (a - E) * r;
|
|
12567
12567
|
}
|
|
12568
|
-
function
|
|
12568
|
+
function q(E, a) {
|
|
12569
12569
|
for (var r = new Float64Array(a), J = 0, D = E.length, Z = 0; Z < D; Z++) {
|
|
12570
12570
|
var xe = E[Z];
|
|
12571
12571
|
r.set(xe, J), J += xe.length;
|
|
@@ -12636,14 +12636,14 @@ var xa = { exports: {} };
|
|
|
12636
12636
|
AudioContextConstructor: null,
|
|
12637
12637
|
AudioContext: window.AudioContext || window.webkitAudioContext
|
|
12638
12638
|
}), (!Q.Storage.AudioContextConstructor || Q.Storage.AudioContextConstructor.state === "closed") && (Q.Storage.AudioContextConstructor = new Q.Storage.AudioContext());
|
|
12639
|
-
var pe = Q.Storage.AudioContextConstructor,
|
|
12639
|
+
var pe = Q.Storage.AudioContextConstructor, z = pe.createMediaStreamSource(k), me = [0, 256, 512, 1024, 2048, 4096, 8192, 16384], oe = typeof e.bufferSize > "u" ? 4096 : e.bufferSize;
|
|
12640
12640
|
if (me.indexOf(oe) === -1 && (e.disableLogs || console.log("Legal values for buffer-size are " + JSON.stringify(me, null, " "))), pe.createJavaScriptNode)
|
|
12641
12641
|
x = pe.createJavaScriptNode(oe, i, i);
|
|
12642
12642
|
else if (pe.createScriptProcessor)
|
|
12643
12643
|
x = pe.createScriptProcessor(oe, i, i);
|
|
12644
12644
|
else
|
|
12645
12645
|
throw "WebAudio API has no support on this browser.";
|
|
12646
|
-
|
|
12646
|
+
z.connect(x), e.bufferSize || (oe = x.bufferSize);
|
|
12647
12647
|
var X = typeof e.sampleRate < "u" ? e.sampleRate : pe.sampleRate || 44100;
|
|
12648
12648
|
(X < 22050 || X > 96e3) && (e.disableLogs || console.log("sample-rate must be under range 22050 and 96000.")), e.disableLogs || e.desiredSampRate && console.log("Desired sample-rate: " + e.desiredSampRate);
|
|
12649
12649
|
var Se = !1;
|
|
@@ -12668,7 +12668,7 @@ var xa = { exports: {} };
|
|
|
12668
12668
|
};
|
|
12669
12669
|
}
|
|
12670
12670
|
function V() {
|
|
12671
|
-
x && (x.onaudioprocess = null, x.disconnect(), x = null),
|
|
12671
|
+
x && (x.onaudioprocess = null, x.disconnect(), x = null), z && (z.disconnect(), z = null), Fe();
|
|
12672
12672
|
}
|
|
12673
12673
|
this.name = "StereoAudioRecorder", this.toString = function() {
|
|
12674
12674
|
return this.name;
|
|
@@ -12677,7 +12677,7 @@ var xa = { exports: {} };
|
|
|
12677
12677
|
function o(y) {
|
|
12678
12678
|
if (!Se) {
|
|
12679
12679
|
if (de() === !1 && (e.disableLogs || console.log("MediaStream seems stopped."), x.disconnect(), C = !1), !C) {
|
|
12680
|
-
|
|
12680
|
+
z && (z.disconnect(), z = null);
|
|
12681
12681
|
return;
|
|
12682
12682
|
}
|
|
12683
12683
|
se || (se = !0, e.onAudioProcessStarted && e.onAudioProcessStarted(), e.initCallback && e.initCallback());
|
|
@@ -12695,7 +12695,7 @@ var xa = { exports: {} };
|
|
|
12695
12695
|
right: [],
|
|
12696
12696
|
recordingLength: 0
|
|
12697
12697
|
};
|
|
12698
|
-
function
|
|
12698
|
+
function j() {
|
|
12699
12699
|
!C || typeof e.ondataavailable != "function" || typeof e.timeSlice > "u" || (A.left.length ? (ke({
|
|
12700
12700
|
desiredSampRate: ie,
|
|
12701
12701
|
sampleRate: X,
|
|
@@ -12707,12 +12707,12 @@ var xa = { exports: {} };
|
|
|
12707
12707
|
var m = new Blob([ye], {
|
|
12708
12708
|
type: "audio/wav"
|
|
12709
12709
|
});
|
|
12710
|
-
e.ondataavailable(m), setTimeout(
|
|
12710
|
+
e.ondataavailable(m), setTimeout(j, e.timeSlice);
|
|
12711
12711
|
}), A = {
|
|
12712
12712
|
left: [],
|
|
12713
12713
|
right: [],
|
|
12714
12714
|
recordingLength: 0
|
|
12715
|
-
}) : setTimeout(
|
|
12715
|
+
}) : setTimeout(j, e.timeSlice));
|
|
12716
12716
|
}
|
|
12717
12717
|
}
|
|
12718
12718
|
typeof Q < "u" && (Q.StereoAudioRecorder = Je);
|
|
@@ -12769,19 +12769,19 @@ var xa = { exports: {} };
|
|
|
12769
12769
|
mimeType: e.mimeType || "video/webm"
|
|
12770
12770
|
}), x.record();
|
|
12771
12771
|
} else
|
|
12772
|
-
|
|
12772
|
+
z.frames = [], pe = (/* @__PURE__ */ new Date()).getTime(), Oe();
|
|
12773
12773
|
e.initCallback && e.initCallback();
|
|
12774
12774
|
}, this.getWebPImages = function(me) {
|
|
12775
12775
|
if (k.nodeName.toLowerCase() !== "canvas") {
|
|
12776
12776
|
me();
|
|
12777
12777
|
return;
|
|
12778
12778
|
}
|
|
12779
|
-
var oe =
|
|
12780
|
-
|
|
12779
|
+
var oe = z.frames.length;
|
|
12780
|
+
z.frames.forEach(function(X, Se) {
|
|
12781
12781
|
var Fe = oe - Se;
|
|
12782
12782
|
e.disableLogs || console.log(Fe + "/" + oe + " frames remaining"), e.onEncodingCallback && e.onEncodingCallback(Fe, oe);
|
|
12783
12783
|
var V = X.image.toDataURL("image/webp", 1);
|
|
12784
|
-
|
|
12784
|
+
z.frames[Se].image = V;
|
|
12785
12785
|
}), e.disableLogs || console.log("Generating WebM"), me();
|
|
12786
12786
|
}, this.stop = function(me) {
|
|
12787
12787
|
i = !1;
|
|
@@ -12791,10 +12791,10 @@ var xa = { exports: {} };
|
|
|
12791
12791
|
return;
|
|
12792
12792
|
}
|
|
12793
12793
|
this.getWebPImages(function() {
|
|
12794
|
-
|
|
12794
|
+
z.compile(function(X) {
|
|
12795
12795
|
e.disableLogs || console.log("Recording finished!"), oe.blob = X, oe.blob.forEach && (oe.blob = new Blob([], {
|
|
12796
12796
|
type: "video/webm"
|
|
12797
|
-
})), me && me(oe.blob),
|
|
12797
|
+
})), me && me(oe.blob), z.frames = [];
|
|
12798
12798
|
});
|
|
12799
12799
|
});
|
|
12800
12800
|
};
|
|
@@ -12814,7 +12814,7 @@ var xa = { exports: {} };
|
|
|
12814
12814
|
i && this.stop(de), de();
|
|
12815
12815
|
};
|
|
12816
12816
|
function de() {
|
|
12817
|
-
|
|
12817
|
+
z.frames = [], i = !1, ie = !1;
|
|
12818
12818
|
}
|
|
12819
12819
|
this.name = "CanvasRecorder", this.toString = function() {
|
|
12820
12820
|
return this.name;
|
|
@@ -12828,7 +12828,7 @@ var xa = { exports: {} };
|
|
|
12828
12828
|
return pe = (/* @__PURE__ */ new Date()).getTime(), setTimeout(Oe, 500);
|
|
12829
12829
|
if (k.nodeName.toLowerCase() === "canvas") {
|
|
12830
12830
|
var me = (/* @__PURE__ */ new Date()).getTime() - pe;
|
|
12831
|
-
pe = (/* @__PURE__ */ new Date()).getTime(),
|
|
12831
|
+
pe = (/* @__PURE__ */ new Date()).getTime(), z.frames.push({
|
|
12832
12832
|
image: ke(),
|
|
12833
12833
|
duration: me
|
|
12834
12834
|
}), i && setTimeout(Oe, e.frameInterval);
|
|
@@ -12840,14 +12840,14 @@ var xa = { exports: {} };
|
|
|
12840
12840
|
var X = (/* @__PURE__ */ new Date()).getTime() - pe;
|
|
12841
12841
|
if (!X)
|
|
12842
12842
|
return setTimeout(Oe, e.frameInterval);
|
|
12843
|
-
pe = (/* @__PURE__ */ new Date()).getTime(),
|
|
12843
|
+
pe = (/* @__PURE__ */ new Date()).getTime(), z.frames.push({
|
|
12844
12844
|
image: oe.toDataURL("image/webp", 1),
|
|
12845
12845
|
duration: X
|
|
12846
12846
|
}), i && setTimeout(Oe, e.frameInterval);
|
|
12847
12847
|
}
|
|
12848
12848
|
});
|
|
12849
12849
|
}
|
|
12850
|
-
var pe = (/* @__PURE__ */ new Date()).getTime(),
|
|
12850
|
+
var pe = (/* @__PURE__ */ new Date()).getTime(), z = new Be.Video(100);
|
|
12851
12851
|
}
|
|
12852
12852
|
typeof Q < "u" && (Q.CanvasRecorder = Ie);
|
|
12853
12853
|
/**
|
|
@@ -12881,29 +12881,29 @@ var xa = { exports: {} };
|
|
|
12881
12881
|
};
|
|
12882
12882
|
function s(pe) {
|
|
12883
12883
|
pe = typeof pe < "u" ? pe : 10;
|
|
12884
|
-
var
|
|
12885
|
-
if (!
|
|
12884
|
+
var z = (/* @__PURE__ */ new Date()).getTime() - ke;
|
|
12885
|
+
if (!z)
|
|
12886
12886
|
return setTimeout(s, pe, pe);
|
|
12887
12887
|
if (W)
|
|
12888
12888
|
return ke = (/* @__PURE__ */ new Date()).getTime(), setTimeout(s, 100);
|
|
12889
12889
|
ke = (/* @__PURE__ */ new Date()).getTime(), de.paused && de.play(), ie.drawImage(de, 0, 0, i.width, i.height), Oe.frames.push({
|
|
12890
|
-
duration:
|
|
12890
|
+
duration: z,
|
|
12891
12891
|
image: i.toDataURL("image/webp")
|
|
12892
12892
|
}), C || setTimeout(s, pe, pe);
|
|
12893
12893
|
}
|
|
12894
12894
|
function d(pe) {
|
|
12895
|
-
var
|
|
12895
|
+
var z = -1, me = pe.length;
|
|
12896
12896
|
(function oe() {
|
|
12897
|
-
if (
|
|
12897
|
+
if (z++, z === me) {
|
|
12898
12898
|
pe.callback();
|
|
12899
12899
|
return;
|
|
12900
12900
|
}
|
|
12901
12901
|
setTimeout(function() {
|
|
12902
|
-
pe.functionToLoop(oe,
|
|
12902
|
+
pe.functionToLoop(oe, z);
|
|
12903
12903
|
}, 1);
|
|
12904
12904
|
})();
|
|
12905
12905
|
}
|
|
12906
|
-
function h(pe,
|
|
12906
|
+
function h(pe, z, me, oe, X) {
|
|
12907
12907
|
var Se = document.createElement("canvas");
|
|
12908
12908
|
Se.width = i.width, Se.height = i.height;
|
|
12909
12909
|
var Fe = Se.getContext("2d"), V = [], se = pe.length, o = {
|
|
@@ -12912,7 +12912,7 @@ var xa = { exports: {} };
|
|
|
12912
12912
|
b: 0
|
|
12913
12913
|
}, A = Math.sqrt(
|
|
12914
12914
|
Math.pow(255, 2) + Math.pow(255, 2) + Math.pow(255, 2)
|
|
12915
|
-
),
|
|
12915
|
+
), j = 0, y = 0, ye = !1;
|
|
12916
12916
|
d({
|
|
12917
12917
|
length: se,
|
|
12918
12918
|
functionToLoop: function(m, P) {
|
|
@@ -12935,7 +12935,7 @@ var xa = { exports: {} };
|
|
|
12935
12935
|
}, l = Math.sqrt(
|
|
12936
12936
|
Math.pow(t.r - o.r, 2) + Math.pow(t.g - o.g, 2) + Math.pow(t.b - o.b, 2)
|
|
12937
12937
|
);
|
|
12938
|
-
l <= A *
|
|
12938
|
+
l <= A * j && fe++;
|
|
12939
12939
|
}
|
|
12940
12940
|
O();
|
|
12941
12941
|
}, Te.src = pe[P].image;
|
|
@@ -12950,13 +12950,13 @@ var xa = { exports: {} };
|
|
|
12950
12950
|
this.stop = function(pe) {
|
|
12951
12951
|
pe = pe || function() {
|
|
12952
12952
|
}, C = !0;
|
|
12953
|
-
var
|
|
12953
|
+
var z = this;
|
|
12954
12954
|
setTimeout(function() {
|
|
12955
12955
|
h(Oe.frames, -1, null, null, function(me) {
|
|
12956
12956
|
Oe.frames = me, e.advertisement && e.advertisement.length && (Oe.frames = e.advertisement.concat(Oe.frames)), Oe.compile(function(oe) {
|
|
12957
|
-
|
|
12957
|
+
z.blob = oe, z.blob.forEach && (z.blob = new Blob([], {
|
|
12958
12958
|
type: "video/webm"
|
|
12959
|
-
})), pe && pe(
|
|
12959
|
+
})), pe && pe(z.blob);
|
|
12960
12960
|
});
|
|
12961
12961
|
});
|
|
12962
12962
|
}, 10);
|
|
@@ -13123,16 +13123,16 @@ var xa = { exports: {} };
|
|
|
13123
13123
|
}]
|
|
13124
13124
|
}]
|
|
13125
13125
|
}], se = 0, o = 0; se < X.length; ) {
|
|
13126
|
-
var A = [],
|
|
13126
|
+
var A = [], j = 0;
|
|
13127
13127
|
do
|
|
13128
|
-
A.push(X[se]),
|
|
13129
|
-
while (se < X.length &&
|
|
13128
|
+
A.push(X[se]), j += X[se].duration, se++;
|
|
13129
|
+
while (se < X.length && j < Fe);
|
|
13130
13130
|
var y = 0, ye = {
|
|
13131
13131
|
id: 524531317,
|
|
13132
13132
|
// Cluster
|
|
13133
13133
|
data: C(o, y, A)
|
|
13134
13134
|
};
|
|
13135
|
-
V[1].data.push(ye), o +=
|
|
13135
|
+
V[1].data.push(ye), o += j;
|
|
13136
13136
|
}
|
|
13137
13137
|
return de(V);
|
|
13138
13138
|
}
|
|
@@ -13193,7 +13193,7 @@ var xa = { exports: {} };
|
|
|
13193
13193
|
for (var Se = [], Fe = 0; Fe < X.length; Fe++) {
|
|
13194
13194
|
var V = X[Fe].data;
|
|
13195
13195
|
typeof V == "object" && (V = de(V)), typeof V == "number" && (V = ie(V.toString(2))), typeof V == "string" && (V = i(V));
|
|
13196
|
-
var se = V.size || V.byteLength || V.length, o = Math.ceil(Math.ceil(Math.log(se) / Math.log(2)) / 8), A = se.toString(2),
|
|
13196
|
+
var se = V.size || V.byteLength || V.length, o = Math.ceil(Math.ceil(Math.log(se) / Math.log(2)) / 8), A = se.toString(2), j = new Array(o * 7 + 7 + 1 - A.length).join("0") + A, y = new Array(o).join("0") + "1" + j;
|
|
13197
13197
|
Se.push(x(X[Fe].id)), Se.push(ie(y)), Se.push(V);
|
|
13198
13198
|
}
|
|
13199
13199
|
return new Blob(Se, {
|
|
@@ -13212,8 +13212,8 @@ var xa = { exports: {} };
|
|
|
13212
13212
|
function Oe(X) {
|
|
13213
13213
|
for (var Se = X.RIFF[0].WEBP[0], Fe = Se.indexOf("*"), V = 0, se = []; V < 4; V++)
|
|
13214
13214
|
se[V] = Se.charCodeAt(Fe + 3 + V);
|
|
13215
|
-
var o, A,
|
|
13216
|
-
return
|
|
13215
|
+
var o, A, j;
|
|
13216
|
+
return j = se[1] << 8 | se[0], o = j & 16383, j = se[3] << 8 | se[2], A = j & 16383, {
|
|
13217
13217
|
width: o,
|
|
13218
13218
|
height: A,
|
|
13219
13219
|
data: Se,
|
|
@@ -13226,10 +13226,10 @@ var xa = { exports: {} };
|
|
|
13226
13226
|
return new Array(8 - V.length + 1).join("0") + V;
|
|
13227
13227
|
}).join(""), 2);
|
|
13228
13228
|
}
|
|
13229
|
-
function
|
|
13229
|
+
function z(X) {
|
|
13230
13230
|
for (var Se = 0, Fe = {}; Se < X.length; ) {
|
|
13231
13231
|
var V = X.substr(Se, 4), se = pe(X, Se), o = X.substr(Se + 4 + 4, se);
|
|
13232
|
-
Se += 8 + se, Fe[V] = Fe[V] || [], V === "RIFF" || V === "LIST" ? Fe[V].push(
|
|
13232
|
+
Se += 8 + se, Fe[V] = Fe[V] || [], V === "RIFF" || V === "LIST" ? Fe[V].push(z(o)) : Fe[V].push(o);
|
|
13233
13233
|
}
|
|
13234
13234
|
return Fe;
|
|
13235
13235
|
}
|
|
@@ -13242,7 +13242,7 @@ var xa = { exports: {} };
|
|
|
13242
13242
|
}).reverse().join("");
|
|
13243
13243
|
}
|
|
13244
13244
|
var oe = new h(d.map(function(X) {
|
|
13245
|
-
var Se = Oe(
|
|
13245
|
+
var Se = Oe(z(atob(X.image.slice(23))));
|
|
13246
13246
|
return Se.duration = X.duration, Se;
|
|
13247
13247
|
}));
|
|
13248
13248
|
postMessage(oe);
|
|
@@ -13432,21 +13432,21 @@ var xa = { exports: {} };
|
|
|
13432
13432
|
width: e.width,
|
|
13433
13433
|
height: e.height
|
|
13434
13434
|
}), W.width = e.canvas.width || 320, W.height = e.canvas.height || 240, ie.width = e.video.width || 320, ie.height = e.video.height || 240), Oe = new GIFEncoder(), Oe.setRepeat(0), Oe.setDelay(e.frameRate || 200), Oe.setQuality(e.quality || 10), Oe.start(), typeof e.onGifRecordingStarted == "function" && e.onGifRecordingStarted();
|
|
13435
|
-
function
|
|
13435
|
+
function z(me) {
|
|
13436
13436
|
if (pe.clearedRecordedData !== !0) {
|
|
13437
13437
|
if (h)
|
|
13438
13438
|
return setTimeout(function() {
|
|
13439
|
-
|
|
13439
|
+
z(me);
|
|
13440
13440
|
}, 100);
|
|
13441
|
-
de = _e(
|
|
13441
|
+
de = _e(z), typeof ke === void 0 && (ke = me), !(me - ke < 90) && (!d && ie.paused && ie.play(), d || x.drawImage(ie, 0, 0, W.width, W.height), e.onGifPreview && e.onGifPreview(W.toDataURL("image/png")), Oe.addFrame(x), ke = me);
|
|
13442
13442
|
}
|
|
13443
13443
|
}
|
|
13444
|
-
de = _e(
|
|
13445
|
-
}, this.stop = function(
|
|
13446
|
-
|
|
13444
|
+
de = _e(z), e.initCallback && e.initCallback();
|
|
13445
|
+
}, this.stop = function(z) {
|
|
13446
|
+
z = z || function() {
|
|
13447
13447
|
}, de && we(de), this.blob = new Blob([new Uint8Array(Oe.stream().bin)], {
|
|
13448
13448
|
type: "image/gif"
|
|
13449
|
-
}),
|
|
13449
|
+
}), z(this.blob), Oe.stream().bin = [];
|
|
13450
13450
|
};
|
|
13451
13451
|
var h = !1;
|
|
13452
13452
|
this.pause = function() {
|
|
@@ -13546,8 +13546,8 @@ var xa = { exports: {} };
|
|
|
13546
13546
|
function pe() {
|
|
13547
13547
|
if (!h) {
|
|
13548
13548
|
var V = d.length, se = !1, o = [];
|
|
13549
|
-
if (d.forEach(function(
|
|
13550
|
-
|
|
13549
|
+
if (d.forEach(function(j) {
|
|
13550
|
+
j.stream || (j.stream = {}), j.stream.fullcanvas ? se = j : o.push(j);
|
|
13551
13551
|
}), se)
|
|
13552
13552
|
C.width = se.stream.width, C.height = se.stream.height;
|
|
13553
13553
|
else if (o.length) {
|
|
@@ -13556,15 +13556,15 @@ var xa = { exports: {} };
|
|
|
13556
13556
|
(V === 3 || V === 4) && (A = 2), (V === 5 || V === 6) && (A = 3), (V === 7 || V === 8) && (A = 4), (V === 9 || V === 10) && (A = 5), C.height = o[0].height * A;
|
|
13557
13557
|
} else
|
|
13558
13558
|
C.width = x.width || 360, C.height = x.height || 240;
|
|
13559
|
-
se && se instanceof HTMLVideoElement &&
|
|
13560
|
-
j
|
|
13559
|
+
se && se instanceof HTMLVideoElement && z(se), o.forEach(function(j, y) {
|
|
13560
|
+
z(j, y);
|
|
13561
13561
|
}), setTimeout(pe, x.frameInterval);
|
|
13562
13562
|
}
|
|
13563
13563
|
}
|
|
13564
|
-
function
|
|
13564
|
+
function z(V, se) {
|
|
13565
13565
|
if (!h) {
|
|
13566
|
-
var o = 0, A = 0,
|
|
13567
|
-
se === 1 && (o = V.width), se === 2 && (A = V.height), se === 3 && (o = V.width, A = V.height), se === 4 && (A = V.height * 2), se === 5 && (o = V.width, A = V.height * 2), se === 6 && (A = V.height * 3), se === 7 && (o = V.width, A = V.height * 3), typeof V.stream.left < "u" && (o = V.stream.left), typeof V.stream.top < "u" && (A = V.stream.top), typeof V.stream.width < "u" && (
|
|
13566
|
+
var o = 0, A = 0, j = V.width, y = V.height;
|
|
13567
|
+
se === 1 && (o = V.width), se === 2 && (A = V.height), se === 3 && (o = V.width, A = V.height), se === 4 && (A = V.height * 2), se === 5 && (o = V.width, A = V.height * 2), se === 6 && (A = V.height * 3), se === 7 && (o = V.width, A = V.height * 3), typeof V.stream.left < "u" && (o = V.stream.left), typeof V.stream.top < "u" && (A = V.stream.top), typeof V.stream.width < "u" && (j = V.stream.width), typeof V.stream.height < "u" && (y = V.stream.height), W.drawImage(V, o, A, j, y), typeof V.stream.onRender == "function" && V.stream.onRender(W, o, A, j, y, se);
|
|
13568
13568
|
}
|
|
13569
13569
|
}
|
|
13570
13570
|
function me() {
|
|
@@ -13625,8 +13625,8 @@ var xa = { exports: {} };
|
|
|
13625
13625
|
if (se.getTracks().filter(function(y) {
|
|
13626
13626
|
return y.kind === "audio";
|
|
13627
13627
|
}).length) {
|
|
13628
|
-
var
|
|
13629
|
-
x.audioDestination = x.audioContext.createMediaStreamDestination(),
|
|
13628
|
+
var j = x.audioContext.createMediaStreamSource(se);
|
|
13629
|
+
x.audioDestination = x.audioContext.createMediaStreamDestination(), j.connect(x.audioDestination), o.addTrack(x.audioDestination.stream.getTracks().filter(function(y) {
|
|
13630
13630
|
return y.kind === "audio";
|
|
13631
13631
|
})[0]);
|
|
13632
13632
|
}
|
|
@@ -13865,7 +13865,7 @@ var xa = { exports: {} };
|
|
|
13865
13865
|
var de = document.createElement("canvas"), ke = document.createElement("video"), Oe = !0;
|
|
13866
13866
|
ke.srcObject = k, ke.muted = !0, ke.height = e.height, ke.width = e.width, ke.volume = 0, ke.onplaying = function() {
|
|
13867
13867
|
de.width = e.width, de.height = e.height;
|
|
13868
|
-
var pe = de.getContext("2d"),
|
|
13868
|
+
var pe = de.getContext("2d"), z = 1e3 / e.frameRate, me = setInterval(function() {
|
|
13869
13869
|
if (s && (clearInterval(me), ie.close()), Oe && (Oe = !1, e.onVideoProcessStarted && e.onVideoProcessStarted()), pe.drawImage(ke, 0, 0), ie._controlledReadableStream.state !== "closed")
|
|
13870
13870
|
try {
|
|
13871
13871
|
ie.enqueue(
|
|
@@ -13873,7 +13873,7 @@ var xa = { exports: {} };
|
|
|
13873
13873
|
);
|
|
13874
13874
|
} catch {
|
|
13875
13875
|
}
|
|
13876
|
-
},
|
|
13876
|
+
}, z);
|
|
13877
13877
|
}, ke.play();
|
|
13878
13878
|
}
|
|
13879
13879
|
});
|
|
@@ -13981,13 +13981,13 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
13981
13981
|
}
|
|
13982
13982
|
async function Le() {
|
|
13983
13983
|
_e.value = !1, await le.value.stopRecording(), H.value = await le.value.getBlob(), le.value.reset(), Ot(() => {
|
|
13984
|
-
|
|
13984
|
+
G(), he.value.src = URL.createObjectURL(H.value);
|
|
13985
13985
|
});
|
|
13986
13986
|
}
|
|
13987
13987
|
function ge() {
|
|
13988
13988
|
he.value.src = null, he.value.muted = !0, he.value.volume = 0, he.value.srcObject = F.value, he.value.autoplay = !0;
|
|
13989
13989
|
}
|
|
13990
|
-
function
|
|
13990
|
+
function G() {
|
|
13991
13991
|
he.value.src = null, he.value.srcObject = null, he.value.muted = !1, he.value.volume = 1, he.value.autoplay = !1;
|
|
13992
13992
|
}
|
|
13993
13993
|
function I() {
|
|
@@ -14072,8 +14072,8 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14072
14072
|
setup(w, { emit: Q }) {
|
|
14073
14073
|
const ae = w, b = Q, le = ct(null), F = ct(null), _e = ct("100vw"), H = ct(null), we = ct(null);
|
|
14074
14074
|
f0(() => {
|
|
14075
|
-
var
|
|
14076
|
-
(
|
|
14075
|
+
var G;
|
|
14076
|
+
(G = F.value) == null || G.stop(), F.value = null;
|
|
14077
14077
|
});
|
|
14078
14078
|
async function he() {
|
|
14079
14079
|
_e.value = ae.responsive ? "100vw" : `${document.querySelector(".record-tree").clientWidth}px`, F.value = await navigator.mediaDevices.getUserMedia({
|
|
@@ -14089,8 +14089,8 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14089
14089
|
const I = `${(/* @__PURE__ */ new Date()).getTime()}.jpeg`, ee = Le(le.value, I);
|
|
14090
14090
|
b("finish", [ee]), b("cancel");
|
|
14091
14091
|
}
|
|
14092
|
-
function Le(
|
|
14093
|
-
let ee =
|
|
14092
|
+
function Le(G, I) {
|
|
14093
|
+
let ee = G.split(","), Ae = ee[0].match(/:(.*?);/)[1], T = atob(ee[1]), K = T.length, ve = new Uint8Array(K);
|
|
14094
14094
|
for (; K--; )
|
|
14095
14095
|
ve[K] = T.charCodeAt(K);
|
|
14096
14096
|
return new File([ve], I, { type: Ae });
|
|
@@ -14098,7 +14098,7 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14098
14098
|
function ge() {
|
|
14099
14099
|
b("cancel");
|
|
14100
14100
|
}
|
|
14101
|
-
return he(), (
|
|
14101
|
+
return he(), (G, I) => (st(), ft("div", {
|
|
14102
14102
|
class: "wrap",
|
|
14103
14103
|
style: Pt({
|
|
14104
14104
|
width: _e.value
|
|
@@ -14238,21 +14238,21 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14238
14238
|
setup(w, { expose: Q, emit: ae }) {
|
|
14239
14239
|
const b = w, le = ae;
|
|
14240
14240
|
Q({ focusTitle: Ue, focusContent: Ce });
|
|
14241
|
-
const F = ct([{ text: "", uuid: Ut() }]), _e = ct(null), H = ct(!1), we = ct(!1), he = ct(!1), be = ct(Ut()), Ee = ct(!1), Le = ct(b.initialLock), ge = ct(null),
|
|
14241
|
+
const F = ct([{ text: "", uuid: Ut() }]), _e = ct(null), H = ct(!1), we = ct(!1), he = ct(!1), be = ct(Ut()), Ee = ct(!1), Le = ct(b.initialLock), ge = ct(null), G = ct(null), I = ct(null), ee = ct(null), Ae = ct(null);
|
|
14242
14242
|
let T = null;
|
|
14243
14243
|
const K = a0(() => !!g0(b.note).rel);
|
|
14244
14244
|
r0(
|
|
14245
14245
|
() => b.note.created_at,
|
|
14246
|
-
(
|
|
14247
|
-
|
|
14246
|
+
(z, me) => {
|
|
14247
|
+
z !== me && (Le.value = b.initialLock);
|
|
14248
14248
|
}
|
|
14249
14249
|
), r0(
|
|
14250
14250
|
() => b.note,
|
|
14251
|
-
(
|
|
14251
|
+
(z, me) => {
|
|
14252
14252
|
clearTimeout(T), T = setTimeout(() => {
|
|
14253
|
-
if (
|
|
14253
|
+
if (z.content && (!_e.value || _e.value !== z.id || z.content !== (me == null ? void 0 : me.content))) {
|
|
14254
14254
|
try {
|
|
14255
|
-
_e.value =
|
|
14255
|
+
_e.value = z.id, F.value = JSON.parse(z.content), F.value.filter((Fe) => !Fe.pending).length || F.value.push({
|
|
14256
14256
|
text: "",
|
|
14257
14257
|
uuid: Ut()
|
|
14258
14258
|
});
|
|
@@ -14260,7 +14260,7 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14260
14260
|
if (b.readOnly)
|
|
14261
14261
|
for (; F.value[F.value.length - 1] && Se(F.value[F.value.length - 1]); )
|
|
14262
14262
|
F.value.pop();
|
|
14263
|
-
pe(
|
|
14263
|
+
pe(z.id), Je();
|
|
14264
14264
|
} catch {
|
|
14265
14265
|
}
|
|
14266
14266
|
T = null;
|
|
@@ -14272,11 +14272,11 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14272
14272
|
function ve() {
|
|
14273
14273
|
typeof b.mobile == "boolean" && (bt.isMobile = b.mobile);
|
|
14274
14274
|
}
|
|
14275
|
-
function re(
|
|
14276
|
-
"content" in b.note && (b.note.content !=
|
|
14275
|
+
function re(z) {
|
|
14276
|
+
"content" in b.note && (b.note.content != z.content || b.note.title != z.title) && (clearTimeout(T), Je(), le("change", {
|
|
14277
14277
|
type: "tree",
|
|
14278
14278
|
data: {
|
|
14279
|
-
...
|
|
14279
|
+
...z,
|
|
14280
14280
|
updated_at: Date.now()
|
|
14281
14281
|
}
|
|
14282
14282
|
}));
|
|
@@ -14288,16 +14288,16 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14288
14288
|
return ge.value.head(!0);
|
|
14289
14289
|
}
|
|
14290
14290
|
function Ue() {
|
|
14291
|
-
return
|
|
14291
|
+
return G.value.focus();
|
|
14292
14292
|
}
|
|
14293
|
-
function Pe(
|
|
14293
|
+
function Pe(z, me = b.note) {
|
|
14294
14294
|
clearTimeout(T);
|
|
14295
|
-
let oe =
|
|
14296
|
-
typeof
|
|
14297
|
-
type:
|
|
14298
|
-
size:
|
|
14299
|
-
content:
|
|
14300
|
-
name:
|
|
14295
|
+
let oe = z;
|
|
14296
|
+
typeof z == "object" && (oe = JSON.stringify({
|
|
14297
|
+
type: z.type,
|
|
14298
|
+
size: z.size,
|
|
14299
|
+
content: z.content,
|
|
14300
|
+
name: z.name
|
|
14301
14301
|
})), le("change", {
|
|
14302
14302
|
// 兼容处理,type已经没必要了
|
|
14303
14303
|
// 现在只有title和tree两种type
|
|
@@ -14310,79 +14310,83 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14310
14310
|
}
|
|
14311
14311
|
});
|
|
14312
14312
|
}
|
|
14313
|
-
function Je(
|
|
14313
|
+
function Je(z = b.note.title) {
|
|
14314
14314
|
if (!b.note.created_at) {
|
|
14315
|
-
const me = M(), oe = Ie(
|
|
14315
|
+
const me = M(), oe = Ie(z);
|
|
14316
14316
|
Ee.value = !oe || !me;
|
|
14317
14317
|
}
|
|
14318
14318
|
}
|
|
14319
|
-
function Ie(
|
|
14320
|
-
return !
|
|
14319
|
+
function Ie(z) {
|
|
14320
|
+
return !z || z === "<p></p>";
|
|
14321
14321
|
}
|
|
14322
14322
|
function M() {
|
|
14323
14323
|
if (F.value.length > 1)
|
|
14324
14324
|
return !1;
|
|
14325
|
-
const
|
|
14326
|
-
return !(
|
|
14325
|
+
const z = F.value[0];
|
|
14326
|
+
return !(z && (z.type || z.text && z.text !== "<p></p>"));
|
|
14327
14327
|
}
|
|
14328
|
-
function Be(
|
|
14329
|
-
Ce(), ge.value.addFiles(
|
|
14328
|
+
function Be(z) {
|
|
14329
|
+
Ce(), ge.value.addFiles(z, F.value[0], -1);
|
|
14330
14330
|
}
|
|
14331
14331
|
function Ve() {
|
|
14332
14332
|
le("dbEnter");
|
|
14333
14333
|
}
|
|
14334
|
-
function Me(
|
|
14335
|
-
F.value =
|
|
14334
|
+
function Me(z) {
|
|
14335
|
+
F.value = z, re({
|
|
14336
14336
|
...b.note,
|
|
14337
|
-
content: JSON.stringify(
|
|
14337
|
+
content: JSON.stringify(z)
|
|
14338
14338
|
});
|
|
14339
14339
|
}
|
|
14340
|
-
function Ye() {
|
|
14341
|
-
const
|
|
14342
|
-
|
|
14340
|
+
function Ye(z) {
|
|
14341
|
+
const me = bt.currentId;
|
|
14342
|
+
me && !Le.value && Gt({ uuid: me }).dispatchEvent(z);
|
|
14343
14343
|
}
|
|
14344
14344
|
function tt() {
|
|
14345
|
-
new KeyboardEvent("keydown", {
|
|
14345
|
+
let z = new KeyboardEvent("keydown", {
|
|
14346
14346
|
bubbles: !0,
|
|
14347
14347
|
cancelable: !0,
|
|
14348
14348
|
key: "Tab",
|
|
14349
14349
|
shiftKey: !0
|
|
14350
|
-
})
|
|
14350
|
+
});
|
|
14351
|
+
Ye(z);
|
|
14351
14352
|
}
|
|
14352
14353
|
function Xe() {
|
|
14353
|
-
new KeyboardEvent("keydown", {
|
|
14354
|
+
let z = new KeyboardEvent("keydown", {
|
|
14354
14355
|
bubbles: !0,
|
|
14355
14356
|
cancelable: !0,
|
|
14356
14357
|
key: "Tab",
|
|
14357
14358
|
shiftKey: !1
|
|
14358
|
-
})
|
|
14359
|
+
});
|
|
14360
|
+
Ye(z);
|
|
14359
14361
|
}
|
|
14360
14362
|
function He() {
|
|
14361
|
-
new KeyboardEvent("keydown", {
|
|
14363
|
+
let z = new KeyboardEvent("keydown", {
|
|
14362
14364
|
bubbles: !0,
|
|
14363
14365
|
cancelable: !0,
|
|
14364
14366
|
key: "ArrowUp",
|
|
14365
14367
|
shiftKey: !1
|
|
14366
|
-
})
|
|
14368
|
+
});
|
|
14369
|
+
Ye(z);
|
|
14367
14370
|
}
|
|
14368
14371
|
function k() {
|
|
14369
|
-
new KeyboardEvent("keydown", {
|
|
14372
|
+
let z = new KeyboardEvent("keydown", {
|
|
14370
14373
|
bubbles: !0,
|
|
14371
14374
|
cancelable: !0,
|
|
14372
14375
|
key: "ArrowDown",
|
|
14373
14376
|
shiftKey: !1
|
|
14374
|
-
})
|
|
14377
|
+
});
|
|
14378
|
+
Ye(z);
|
|
14375
14379
|
}
|
|
14376
14380
|
function e() {
|
|
14377
14381
|
return c0[bt.currentId];
|
|
14378
14382
|
}
|
|
14379
14383
|
function s() {
|
|
14380
|
-
const
|
|
14381
|
-
|
|
14384
|
+
const z = e();
|
|
14385
|
+
z && z.dispatch("bold");
|
|
14382
14386
|
}
|
|
14383
|
-
function d(
|
|
14387
|
+
function d(z) {
|
|
14384
14388
|
const me = e();
|
|
14385
|
-
me && me.dispatch("color",
|
|
14389
|
+
me && me.dispatch("color", z);
|
|
14386
14390
|
}
|
|
14387
14391
|
function h() {
|
|
14388
14392
|
Le.value = !Le.value, Le.value || Ot(() => {
|
|
@@ -14404,16 +14408,16 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14404
14408
|
function ie() {
|
|
14405
14409
|
Le.value || (bt.isMobile ? ee.value.click() : he.value = !0);
|
|
14406
14410
|
}
|
|
14407
|
-
function de(
|
|
14408
|
-
typeof
|
|
14411
|
+
function de(z) {
|
|
14412
|
+
typeof z == "string" ? bt.currentId === "" ? Pe(z) : ge.value.appendNode({
|
|
14409
14413
|
uuid: Ut(),
|
|
14410
|
-
text:
|
|
14411
|
-
}) : ke(
|
|
14414
|
+
text: z
|
|
14415
|
+
}) : ke(z);
|
|
14412
14416
|
}
|
|
14413
|
-
async function ke(
|
|
14414
|
-
if (!
|
|
14417
|
+
async function ke(z, me) {
|
|
14418
|
+
if (!z.length)
|
|
14415
14419
|
return;
|
|
14416
|
-
const oe = Array.from(
|
|
14420
|
+
const oe = Array.from(z).map(async (V) => {
|
|
14417
14421
|
const se = la(V.type), o = URL.createObjectURL(V);
|
|
14418
14422
|
let A = {};
|
|
14419
14423
|
switch ((se.mainType === "image" || se.mainType === "video") && (A = await ua(V, se.mainType)), se.mainType) {
|
|
@@ -14444,12 +14448,12 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14444
14448
|
se === 0 && Se ? Pe(V) : ge.value.appendNode(V);
|
|
14445
14449
|
});
|
|
14446
14450
|
const Fe = b.note.id;
|
|
14447
|
-
ca.uploadFile(
|
|
14451
|
+
ca.uploadFile(z, (V, se) => {
|
|
14448
14452
|
se && se.forEach((o, A) => {
|
|
14449
|
-
const
|
|
14453
|
+
const j = X[A], y = o.data, ye = Se && A === 0;
|
|
14450
14454
|
if (o.code === 0) {
|
|
14451
|
-
const { pending: m, hash: P, ...fe } =
|
|
14452
|
-
switch (ye && delete fe.uuid, fe.content = y.url, ge.value && _e.value === Fe ? ye ? Pe(fe) : ge.value.updateNode(fe) : Oe(Fe, fe),
|
|
14455
|
+
const { pending: m, hash: P, ...fe } = j;
|
|
14456
|
+
switch (ye && delete fe.uuid, fe.content = y.url, ge.value && _e.value === Fe ? ye ? Pe(fe) : ge.value.updateNode(fe) : Oe(Fe, fe), j.type) {
|
|
14453
14457
|
case "file":
|
|
14454
14458
|
case "audio":
|
|
14455
14459
|
I.value.value = "";
|
|
@@ -14465,12 +14469,12 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14465
14469
|
});
|
|
14466
14470
|
});
|
|
14467
14471
|
}
|
|
14468
|
-
function Oe(
|
|
14469
|
-
const oe = `${ra}_${
|
|
14472
|
+
function Oe(z, me) {
|
|
14473
|
+
const oe = `${ra}_${z}`, X = JSON.parse(window.localStorage.getItem(oe) || "[]");
|
|
14470
14474
|
X.push(me), window.localStorage.setItem(oe, JSON.stringify(X));
|
|
14471
14475
|
}
|
|
14472
|
-
function pe(
|
|
14473
|
-
const me = `${ra}_${
|
|
14476
|
+
function pe(z) {
|
|
14477
|
+
const me = `${ra}_${z}`, oe = window.localStorage.getItem(me);
|
|
14474
14478
|
oe && Ot(() => {
|
|
14475
14479
|
const X = JSON.parse(oe);
|
|
14476
14480
|
window.localStorage.removeItem(me), X.forEach((Se) => {
|
|
@@ -14478,7 +14482,7 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14478
14482
|
});
|
|
14479
14483
|
});
|
|
14480
14484
|
}
|
|
14481
|
-
return (
|
|
14485
|
+
return (z, me) => (st(), ft("div", {
|
|
14482
14486
|
class: Ft({
|
|
14483
14487
|
"record-tree-container": !0,
|
|
14484
14488
|
"record-tree-mobile": Ke(bt).isMobile
|
|
@@ -14500,7 +14504,7 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14500
14504
|
et("div", Ln, [
|
|
14501
14505
|
wt(Ke(zr), {
|
|
14502
14506
|
ref_key: "titleEditor",
|
|
14503
|
-
ref:
|
|
14507
|
+
ref: G,
|
|
14504
14508
|
tags: w.tags,
|
|
14505
14509
|
readOnly: w.readOnly || Le.value || K.value,
|
|
14506
14510
|
enableDbEnter: w.enableDbEnter,
|
|
@@ -14543,7 +14547,7 @@ const gn = { class: "record-video" }, xn = { class: "buttons" }, Sn = {
|
|
|
14543
14547
|
isMobile: Ke(bt).isMobile,
|
|
14544
14548
|
onChange: Me,
|
|
14545
14549
|
onFileUpload: ke,
|
|
14546
|
-
onDbEnter: me[0] || (me[0] = (oe) =>
|
|
14550
|
+
onDbEnter: me[0] || (me[0] = (oe) => z.$emit("dbEnter"))
|
|
14547
14551
|
}, null, 8, ["nodes", "tags", "readOnly", "enableDbEnter", "hash", "isMobile"])
|
|
14548
14552
|
])
|
|
14549
14553
|
])
|