Compare commits

..

10 Commits

Author SHA1 Message Date
caoyuchun
1fabe14d62 cyc 2025-04-28 09:26:55 +08:00
caoyuchun
a945b24701 cyc 2025-04-18 08:44:34 +08:00
caoyuchun
b07d4a93a0 cyc 2025-04-08 18:38:57 +08:00
caoyuchun
45d6b38737 cyc 2025-04-02 16:42:29 +08:00
caoyuchun
6b16c49968 cyc 2025-04-01 11:48:29 +08:00
3878753c42 cyc 2025-03-17 08:47:35 +08:00
caoyuchun
b8efeab62c cyc 2025-03-13 10:53:59 +08:00
caoyuchun
ed1a321ae3 caoyuchun 2025-01-08 19:00:20 +08:00
caoyuchun
2b2cf57a31 cyc 2024-10-12 09:21:27 +08:00
caoyuchun
08086690bf cyc 2024-09-13 13:22:40 +08:00
504 changed files with 300723 additions and 77060 deletions

9
.env.production Normal file
View File

@ -0,0 +1,9 @@
NODE_ENV=prod
# VUE_APP_BASE_URL=/reading_1/
# VUE_APP_BASE_URL=/reading/
# BUILD_DIR = "aoxiang"
# VUE_APP_BASE_URL=/dist/
# VUE_APP_NAME=caoyuchun
# VUE_APP_EMAIL=caoyuchun2003@qq.com
# // base: process.env.NODE_ENV == "sub"? process.env.VUE_APP_BASE_URL:"",

8
.env.sub Normal file
View File

@ -0,0 +1,8 @@
# NODE_ENV=sub
# VUE_APP_BASE_URL=/reading_1/
VUE_APP_BASE_URL=/reading/
BUILD_DIR = "aoxiang"
# VUE_APP_BASE_URL=/dist/
# VUE_APP_NAME=caoyuchun
# VUE_APP_EMAIL=caoyuchun2003@qq.com
# // base: process.env.NODE_ENV == "sub"? process.env.VUE_APP_BASE_URL:"",

3
.gitignore vendored
View File

@ -2,7 +2,8 @@
node_modules
/dist
dist.zip
aoxiang.zip
aoxiang
# local env files
.env.local
.env.*.local

11
build.sh Executable file
View File

@ -0,0 +1,11 @@
npm run build
npm run build-sub
rm dist.zip
rm aoxiang.zip
zip -r dist.zip dist/
zip -r aoxiang.zip aoxiang

142
package-lock.json generated
View File

@ -11,9 +11,12 @@
"axios": "^1.7.2",
"core-js": "^3.6.5",
"crypto-js": "^4.2.0",
"echarts": "^5.6.0",
"element-ui": "^2.15.14",
"jquery": "^3.7.1",
"js-base64": "^3.7.7",
"mind-elixir": "^4.0.5",
"vant": "^2.13.2",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
@ -1782,7 +1785,6 @@
"version": "7.24.7",
"resolved": "https://mirrors.cloud.tencent.com/npm/@babel/runtime/-/runtime-7.24.7.tgz",
"integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==",
"dev": true,
"dependencies": {
"regenerator-runtime": "^0.14.0"
},
@ -2300,11 +2302,20 @@
"node": ">= 8"
}
},
"node_modules/@vant/icons": {
"version": "3.0.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vant/icons/-/icons-3.0.2.tgz",
"integrity": "sha512-4OlRVMd0uiDtD9hgSISZW8hB95vU0fFtc41tQchRIyiXkR0tS+DydZOLb8/bQkithrNWhW7Uud38MbKjlJ9lJw=="
},
"node_modules/@vant/popperjs": {
"version": "1.3.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vant/popperjs/-/popperjs-1.3.0.tgz",
"integrity": "sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw=="
},
"node_modules/@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.4.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz",
"integrity": "sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA==",
"dev": true
"integrity": "sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA=="
},
"node_modules/@vue/babel-helper-vue-transform-on": {
"version": "1.2.2",
@ -6314,6 +6325,20 @@
"safer-buffer": "^2.1.0"
}
},
"node_modules/echarts": {
"version": "5.6.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/echarts/-/echarts-5.6.0.tgz",
"integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==",
"dependencies": {
"tslib": "2.3.0",
"zrender": "5.6.1"
}
},
"node_modules/echarts/node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/ee-first/-/ee-first-1.1.1.tgz",
@ -9447,6 +9472,11 @@
"resolved": "https://mirrors.cloud.tencent.com/npm/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"node_modules/js-base64": {
"version": "3.7.7",
"resolved": "https://mirrors.cloud.tencent.com/npm/js-base64/-/js-base64-3.7.7.tgz",
"integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw=="
},
"node_modules/js-message": {
"version": "1.0.7",
"resolved": "https://mirrors.cloud.tencent.com/npm/js-message/-/js-message-1.0.7.tgz",
@ -12299,8 +12329,7 @@
"node_modules/regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
"dev": true
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
},
"node_modules/regenerator-transform": {
"version": "0.15.2",
@ -14970,6 +14999,21 @@
"spdx-expression-parse": "^3.0.0"
}
},
"node_modules/vant": {
"version": "2.13.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/vant/-/vant-2.13.2.tgz",
"integrity": "sha512-anZbbLqXCq+rUJk10D67mn+V/1/i9tfOTdoR+64B0e+0BzV3KFgpHBF76noLa+yX9i/L+8DeL560WMk0GEN38g==",
"dependencies": {
"@babel/runtime": "7.x",
"@vant/icons": "^3.0.2",
"@vant/popperjs": "^1.1.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"vue-lazyload": "1.2.3"
},
"peerDependencies": {
"vue": ">= 2.6.0"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/vary/-/vary-1.1.2.tgz",
@ -15068,6 +15112,11 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
"node_modules/vue-lazyload": {
"version": "1.2.3",
"resolved": "https://mirrors.cloud.tencent.com/npm/vue-lazyload/-/vue-lazyload-1.2.3.tgz",
"integrity": "sha512-DC0ZwxanbRhx79tlA3zY5OYJkH8FYp3WBAnAJbrcuoS8eye1P73rcgAZhyxFSPUluJUTelMB+i/+VkNU/qVm7g=="
},
"node_modules/vue-loader": {
"version": "15.11.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/vue-loader/-/vue-loader-15.11.1.tgz",
@ -16471,6 +16520,19 @@
"resolved": "https://mirrors.cloud.tencent.com/npm/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==",
"dev": true
},
"node_modules/zrender": {
"version": "5.6.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/zrender/-/zrender-5.6.1.tgz",
"integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==",
"dependencies": {
"tslib": "2.3.0"
}
},
"node_modules/zrender/node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
},
"dependencies": {
@ -17669,7 +17731,6 @@
"version": "7.24.7",
"resolved": "https://mirrors.cloud.tencent.com/npm/@babel/runtime/-/runtime-7.24.7.tgz",
"integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.14.0"
}
@ -18126,11 +18187,20 @@
}
}
},
"@vant/icons": {
"version": "3.0.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vant/icons/-/icons-3.0.2.tgz",
"integrity": "sha512-4OlRVMd0uiDtD9hgSISZW8hB95vU0fFtc41tQchRIyiXkR0tS+DydZOLb8/bQkithrNWhW7Uud38MbKjlJ9lJw=="
},
"@vant/popperjs": {
"version": "1.3.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vant/popperjs/-/popperjs-1.3.0.tgz",
"integrity": "sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw=="
},
"@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.4.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz",
"integrity": "sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA==",
"dev": true
"integrity": "sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA=="
},
"@vue/babel-helper-vue-transform-on": {
"version": "1.2.2",
@ -21311,6 +21381,22 @@
"safer-buffer": "^2.1.0"
}
},
"echarts": {
"version": "5.6.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/echarts/-/echarts-5.6.0.tgz",
"integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.6.1"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/ee-first/-/ee-first-1.1.1.tgz",
@ -23706,6 +23792,11 @@
"resolved": "https://mirrors.cloud.tencent.com/npm/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"js-base64": {
"version": "3.7.7",
"resolved": "https://mirrors.cloud.tencent.com/npm/js-base64/-/js-base64-3.7.7.tgz",
"integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw=="
},
"js-message": {
"version": "1.0.7",
"resolved": "https://mirrors.cloud.tencent.com/npm/js-message/-/js-message-1.0.7.tgz",
@ -26060,8 +26151,7 @@
"regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
"dev": true
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
},
"regenerator-transform": {
"version": "0.15.2",
@ -28224,6 +28314,18 @@
"spdx-expression-parse": "^3.0.0"
}
},
"vant": {
"version": "2.13.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/vant/-/vant-2.13.2.tgz",
"integrity": "sha512-anZbbLqXCq+rUJk10D67mn+V/1/i9tfOTdoR+64B0e+0BzV3KFgpHBF76noLa+yX9i/L+8DeL560WMk0GEN38g==",
"requires": {
"@babel/runtime": "7.x",
"@vant/icons": "^3.0.2",
"@vant/popperjs": "^1.1.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"vue-lazyload": "1.2.3"
}
},
"vary": {
"version": "1.1.2",
"resolved": "https://mirrors.cloud.tencent.com/npm/vary/-/vary-1.1.2.tgz",
@ -28326,6 +28428,11 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
"vue-lazyload": {
"version": "1.2.3",
"resolved": "https://mirrors.cloud.tencent.com/npm/vue-lazyload/-/vue-lazyload-1.2.3.tgz",
"integrity": "sha512-DC0ZwxanbRhx79tlA3zY5OYJkH8FYp3WBAnAJbrcuoS8eye1P73rcgAZhyxFSPUluJUTelMB+i/+VkNU/qVm7g=="
},
"vue-loader": {
"version": "15.11.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/vue-loader/-/vue-loader-15.11.1.tgz",
@ -29415,6 +29522,21 @@
"dev": true
}
}
},
"zrender": {
"version": "5.6.1",
"resolved": "https://mirrors.cloud.tencent.com/npm/zrender/-/zrender-5.6.1.tgz",
"integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==",
"requires": {
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
}
}
}

View File

@ -3,17 +3,24 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"dev": "vue-cli-service serve --mode development",
"prod": "vue-cli-service serve --mode production",
"serve-aoxiang": "vue-cli-service serve --mode sub",
"serve-zyx": "vue-cli-service serve --mode sub",
"build": "vue-cli-service build",
"build-sub": "vue-cli-service build --mode sub",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^1.7.2",
"core-js": "^3.6.5",
"crypto-js": "^4.2.0",
"echarts": "^5.6.0",
"element-ui": "^2.15.14",
"jquery": "^3.7.1",
"js-base64": "^3.7.7",
"mind-elixir": "^4.0.5",
"vant": "^2.13.2",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",

View File

@ -0,0 +1,254 @@
var CryptoJSNew = CryptoJSNew || function(g, l) {
var e = {}, d = e.lib = {}, m = function() {}, k = d.Base = {
extend: function(a) {
m.prototype = this;
var c = new m;
a && c.mixIn(a);
c.hasOwnProperty("init") || (c.init = function() {
c.$super.init.apply(this, arguments)
});
c.init.prototype = c;
c.$super = this;
return c
},
create: function() {
var a = this.extend();
a.init.apply(a, arguments);
return a
},
init: function() {},
mixIn: function(a) {
for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]);
a.hasOwnProperty("toString") && (this.toString = a.toString)
},
clone: function() {
return this.init.prototype.extend(this)
}
},
p = d.WordArray = k.extend({
init: function(a, c) {
a = this.words = a || [];
this.sigBytes = c != l ? c : 4 * a.length
},
toString: function(a) {
return (a || n).stringify(this)
},
concat: function(a) {
var c = this.words,
q = a.words,
f = this.sigBytes;
a = a.sigBytes;
this.clamp();
if (f % 4)
for (var b = 0; b < a; b++) c[f + b >>> 2] |= (q[b >>> 2] >>> 24 - 8 * (b % 4) & 255) << 24 - 8 * ((f + b) % 4);
else if (65535 < q.length)
for (b = 0; b < a; b += 4) c[f + b >>> 2] = q[b >>> 2];
else c.push.apply(c, q);
this.sigBytes += a;
return this
},
clamp: function() {
var a = this.words,
c = this.sigBytes;
a[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4);
a.length = g.ceil(c / 4)
},
clone: function() {
var a = k.clone.call(this);
a.words = this.words.slice(0);
return a
},
random: function(a) {
for (var c = [], b = 0; b < a; b += 4) c.push(4294967296 * g.random() | 0);
return new p.init(c, a)
}
}),
b = e.enc = {}, n = b.Hex = {
stringify: function(a) {
var c = a.words;
a = a.sigBytes;
for (var b = [], f = 0; f < a; f++) {
var d = c[f >>> 2] >>> 24 - 8 * (f % 4) & 255;
b.push((d >>> 4).toString(16));
b.push((d & 15).toString(16))
}
return b.join("")
},
parse: function(a) {
for (var c = a.length, b = [], f = 0; f < c; f += 2) b[f >>> 3] |= parseInt(a.substr(f, 2), 16) << 24 - 4 * (f % 8);
return new p.init(b, c / 2)
}
}, j = b.Latin1 = {
stringify: function(a) {
var c = a.words;
a = a.sigBytes;
for (var b = [], f = 0; f < a; f++) b.push(String.fromCharCode(c[f >>> 2] >>> 24 - 8 * (f % 4) & 255));
return b.join("")
},
parse: function(a) {
for (var c = a.length, b = [], f = 0; f < c; f++) b[f >>> 2] |= (a.charCodeAt(f) & 255) << 24 - 8 * (f % 4);
return new p.init(b, c)
}
}, h = b.Utf8 = {
stringify: function(a) {
try {
return decodeURIComponent(escape(j.stringify(a)))
} catch (c) {
throw Error("Malformed UTF-8 data");
}
},
parse: function(a) {
return j.parse(unescape(encodeURIComponent(a)))
}
},
r = d.BufferedBlockAlgorithm = k.extend({
reset: function() {
this._data = new p.init;
this._nDataBytes = 0
},
_append: function(a) {
"string" == typeof a && (a = h.parse(a));
this._data.concat(a);
this._nDataBytes += a.sigBytes
},
_process: function(a) {
var c = this._data,
b = c.words,
f = c.sigBytes,
d = this.blockSize,
e = f / (4 * d),
e = a ? g.ceil(e) : g.max((e | 0) - this._minBufferSize, 0);
a = e * d;
f = g.min(4 * a, f);
if (a) {
for (var k = 0; k < a; k += d) this._doProcessBlock(b, k);
k = b.splice(0, a);
c.sigBytes -= f
}
return new p.init(k, f)
},
clone: function() {
var a = k.clone.call(this);
a._data = this._data.clone();
return a
},
_minBufferSize: 0
});
d.Hasher = r.extend({
cfg: k.extend(),
init: function(a) {
this.cfg = this.cfg.extend(a);
this.reset()
},
reset: function() {
r.reset.call(this);
this._doReset()
},
update: function(a) {
this._append(a);
this._process();
return this
},
finalize: function(a) {
a && this._append(a);
return this._doFinalize()
},
blockSize: 16,
_createHelper: function(a) {
return function(b, d) {
return (new a.init(d)).finalize(b)
}
},
_createHmacHelper: function(a) {
return function(b, d) {
return (new s.HMAC.init(a, d)).finalize(b)
}
}
});
var s = e.algo = {};
return e
}(Math);
(function() {
var g = CryptoJSNew,
l = g.lib,
e = l.WordArray,
d = l.Hasher,
m = [],
l = g.algo.SHA1 = d.extend({
_doReset: function() {
this._hash = new e.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
},
_doProcessBlock: function(d, e) {
for (var b = this._hash.words, n = b[0], j = b[1], h = b[2], g = b[3], l = b[4], a = 0; 80 > a; a++) {
if (16 > a) m[a] = d[e + a] | 0;
else {
var c = m[a - 3] ^ m[a - 8] ^ m[a - 14] ^ m[a - 16];
m[a] = c << 1 | c >>> 31
}
c = (n << 5 | n >>> 27) + l + m[a];
c = 20 > a ? c + ((j & h | ~j & g) + 1518500249) : 40 > a ? c + ((j ^ h ^ g) + 1859775393) : 60 > a ? c + ((j & h | j & g | h & g) - 1894007588) : c + ((j ^ h ^ g) - 899497514);
l = g;
g = h;
h = j << 30 | j >>> 2;
j = n;
n = c
}
b[0] = b[0] + n | 0;
b[1] = b[1] + j | 0;
b[2] = b[2] + h | 0;
b[3] = b[3] + g | 0;
b[4] = b[4] + l | 0
},
_doFinalize: function() {
var d = this._data,
e = d.words,
b = 8 * this._nDataBytes,
g = 8 * d.sigBytes;
e[g >>> 5] |= 128 << 24 - g % 32;
e[(g + 64 >>> 9 << 4) + 14] = Math.floor(b / 4294967296);
e[(g + 64 >>> 9 << 4) + 15] = b;
d.sigBytes = 4 * e.length;
this._process();
return this._hash
},
clone: function() {
var e = d.clone.call(this);
e._hash = this._hash.clone();
return e
}
});
g.SHA1 = d._createHelper(l);
g.HmacSHA1 = d._createHmacHelper(l)
})();
(function() {
var g = CryptoJSNew,
l = g.enc.Utf8;
g.algo.HMAC = g.lib.Base.extend({
init: function(e, d) {
e = this._hasher = new e.init;
"string" == typeof d && (d = l.parse(d));
var g = e.blockSize,
k = 4 * g;
d.sigBytes > k && (d = e.finalize(d));
d.clamp();
for (var p = this._oKey = d.clone(), b = this._iKey = d.clone(), n = p.words, j = b.words, h = 0; h < g; h++) n[h] ^= 1549556828, j[h] ^= 909522486;
p.sigBytes = b.sigBytes = k;
this.reset()
},
reset: function() {
var e = this._hasher;
e.reset();
e.update(this._iKey)
},
update: function(e) {
this._hasher.update(e);
return this
},
finalize: function(e) {
var d = this._hasher;
e = d.finalize(e);
d.reset();
return d.finalize(this._oKey.clone().concat(e))
}
})
})();

File diff suppressed because it is too large Load Diff

30
public/audio/example/enc-base64-min.js vendored Normal file
View File

@ -0,0 +1,30 @@
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function () {
var h = CryptoJS, j = h.lib.WordArray
h.enc.Base64 = {
stringify: function (b) {
var e = b.words, f = b.sigBytes, c = this._map
b.clamp()
b = []
for (var a = 0; a < f; a += 3)for (var d = (e[a >>> 2] >>> 24 - 8 * (a % 4) & 255) << 16 | (e[a + 1 >>> 2] >>> 24 - 8 * ((a + 1) % 4) & 255) << 8 | e[a + 2 >>> 2] >>> 24 - 8 * ((a + 2) % 4) & 255,
g = 0; 4 > g && a + 0.75 * g < f; g++)b.push(c.charAt(d >>> 6 * (3 - g) & 63))
if (e = c.charAt(64))for (; b.length % 4;)b.push(e);
return b.join('')
}, parse: function (b) {
var e = b.length, f = this._map, c = f.charAt(64)
c && (c = b.indexOf(c), -1 != c && (e = c))
for (var c = [], a = 0, d = 0; d <
e; d++)if (d % 4) {
var g = f.indexOf(b.charAt(d - 1)) << 2 * (d % 4), h = f.indexOf(b.charAt(d)) >>> 6 - 2 * (d % 4)
c[a >>> 2] |= (g | h) << 24 - 8 * (a % 4)
a++
}
return j.create(c, a)
}, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
}
})()

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(h,s){var f={},g=f.lib={},q=function(){},m=g.Base={extend:function(a){q.prototype=this;var c=new q;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
r=g.WordArray=m.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=s?c:4*a.length},toString:function(a){return(a||k).stringify(this)},concat:function(a){var c=this.words,d=a.words,b=this.sigBytes;a=a.sigBytes;this.clamp();if(b%4)for(var e=0;e<a;e++)c[b+e>>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((b+e)%4);else if(65535<d.length)for(e=0;e<a;e+=4)c[b+e>>>2]=d[e>>>2];else c.push.apply(c,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
32-8*(c%4);a.length=h.ceil(c/4)},clone:function(){var a=m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],d=0;d<a;d+=4)c.push(4294967296*h.random()|0);return new r.init(c,a)}}),l=f.enc={},k=l.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var d=[],b=0;b<a;b++){var e=c[b>>>2]>>>24-8*(b%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var c=a.length,d=[],b=0;b<c;b+=2)d[b>>>3]|=parseInt(a.substr(b,
2),16)<<24-4*(b%8);return new r.init(d,c/2)}},n=l.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var d=[],b=0;b<a;b++)d.push(String.fromCharCode(c[b>>>2]>>>24-8*(b%4)&255));return d.join("")},parse:function(a){for(var c=a.length,d=[],b=0;b<c;b++)d[b>>>2]|=(a.charCodeAt(b)&255)<<24-8*(b%4);return new r.init(d,c)}},j=l.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},
u=g.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,d=c.words,b=c.sigBytes,e=this.blockSize,f=b/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;b=h.min(4*a,b);if(a){for(var g=0;g<a;g+=e)this._doProcessBlock(d,g);g=d.splice(0,a);c.sigBytes-=b}return new r.init(g,b)},clone:function(){var a=m.clone.call(this);
a._data=this._data.clone();return a},_minBufferSize:0});g.Hasher=u.extend({cfg:m.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){u.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(c,d){return(new a.init(d)).finalize(c)}},_createHmacHelper:function(a){return function(c,d){return(new t.HMAC.init(a,
d)).finalize(c)}}});var t=f.algo={};return f}(Math);
(function(h){for(var s=CryptoJS,f=s.lib,g=f.WordArray,q=f.Hasher,f=s.algo,m=[],r=[],l=function(a){return 4294967296*(a-(a|0))|0},k=2,n=0;64>n;){var j;a:{j=k;for(var u=h.sqrt(j),t=2;t<=u;t++)if(!(j%t)){j=!1;break a}j=!0}j&&(8>n&&(m[n]=l(h.pow(k,0.5))),r[n]=l(h.pow(k,1/3)),n++);k++}var a=[],f=f.SHA256=q.extend({_doReset:function(){this._hash=new g.init(m.slice(0))},_doProcessBlock:function(c,d){for(var b=this._hash.words,e=b[0],f=b[1],g=b[2],j=b[3],h=b[4],m=b[5],n=b[6],q=b[7],p=0;64>p;p++){if(16>p)a[p]=
c[d+p]|0;else{var k=a[p-15],l=a[p-2];a[p]=((k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3)+a[p-7]+((l<<15|l>>>17)^(l<<13|l>>>19)^l>>>10)+a[p-16]}k=q+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&m^~h&n)+r[p]+a[p];l=((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+(e&f^e&g^f&g);q=n;n=m;m=h;h=j+k|0;j=g;g=f;f=e;e=k+l|0}b[0]=b[0]+e|0;b[1]=b[1]+f|0;b[2]=b[2]+g|0;b[3]=b[3]+j|0;b[4]=b[4]+h|0;b[5]=b[5]+m|0;b[6]=b[6]+n|0;b[7]=b[7]+q|0},_doFinalize:function(){var a=this._data,d=a.words,b=8*this._nDataBytes,e=8*a.sigBytes;
d[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=h.floor(b/4294967296);d[(e+64>>>9<<4)+15]=b;a.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var a=q.clone.call(this);a._hash=this._hash.clone();return a}});s.SHA256=q._createHelper(f);s.HmacSHA256=q._createHmacHelper(f)})(Math);
(function(){var h=CryptoJS,s=h.enc.Utf8;h.algo.HMAC=h.lib.Base.extend({init:function(f,g){f=this._hasher=new f.init;"string"==typeof g&&(g=s.parse(g));var h=f.blockSize,m=4*h;g.sigBytes>m&&(g=f.finalize(g));g.clamp();for(var r=this._oKey=g.clone(),l=this._iKey=g.clone(),k=r.words,n=l.words,j=0;j<h;j++)k[j]^=1549556828,n[j]^=909522486;r.sigBytes=l.sigBytes=m;this.reset()},reset:function(){var f=this._hasher;f.reset();f.update(this._iKey)},update:function(f){this._hasher.update(f);return this},finalize:function(f){var g=
this._hasher;f=g.finalize(f);g.reset();return g.finalize(this._oKey.clone().concat(f))}})})();

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<textarea placeholder="where are you" style="width: 500px; height: 100px;"></textarea>
<br />
<button id="btn_control">开始录音</button>
<div class="output-box" id="result_output">
<div class="left">
<p>准确度分:<span id="accuracy_score">0</span></p>
<p>流畅度分:<span id="fluency_score">0</span></p>
<p>完整度分:<span id="integrity_score">0</span></p>
<p>声韵分(仅限中文):<span id="phone_score">0</span></p>
<p>调型分(仅限中文):<span id="tone_score">0</span></p>
<p>整体印象分(仅限中文):<span id="emotion_score">0</span></p>
<p>总分:<span id="total_score">0</span></p>
</div>
<div id="right" style="display: none;">
<p class="title">红色文字代表发音不标准:</p>
<p id="result"></p>
</div>
</div>
<script>
const APPID = "a037e378";
const API_SECRET = "ZDRiNzk3ZGMxMTkzYjQ0YWZjNjZiMGVi";
const API_KEY = "0f529746e414d63bf4ca4ee6e4aee9d4";
</script>
<script src="../fast-xml-parser.min.js"></script>
<script src="../crypto-js.js"></script>
<script src="../../dist/index.umd.js"></script>
<script src="./index.js"></script>
</body>
</html>

View File

@ -0,0 +1,240 @@
(function () {
console.log('111111111111111111111111111111111111');
const APPID = "a037e378";
const API_SECRET = "ZDRiNzk3ZGMxMTkzYjQ0YWZjNjZiMGVi";
const API_KEY = "0f529746e414d63bf4ca4ee6e4aee9d4";
let btnStatus = "UNDEFINED"; // "UNDEFINED" "CONNECTING" "OPEN" "CLOSING" "CLOSED"
const btnControl = document.getElementById("btn_control");
console.log(btnControl);
const recorder = new RecorderManager("../../dist");
recorder.onStart = () => {
changeBtnStatus("OPEN");
}
let iseWS;
/**
* 获取websocket url
* 该接口需要后端提供这里为了方便前端处理
*/
function getWebSocketUrl() {
// 请求地址根据语种不同变化
var url = "wss://ise-api.xfyun.cn/v2/open-ise";
var host = "ise-api.xfyun.cn";
var apiKey = API_KEY;
var apiSecret = API_SECRET;
var date = new Date().toGMTString();
var algorithm = "hmac-sha256";
var headers = "host date request-line";
var signatureOrigin = `host: ${host}\ndate: ${date}\nGET /v2/open-ise HTTP/1.1`;
var signatureSha = CryptoJS.HmacSHA256(signatureOrigin, apiSecret);
var signature = CryptoJS.enc.Base64.stringify(signatureSha);
var authorizationOrigin = `api_key="${apiKey}", algorithm="${algorithm}", headers="${headers}", signature="${signature}"`;
var authorization = btoa(authorizationOrigin);
url = `${url}?authorization=${authorization}&date=${date}&host=${host}`;
return url;
}
function toBase64(buffer) {
console.log(buffer);
var binary = "";
var bytes = new Uint8Array(buffer);
console.log(bytes);
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
// console.log(window.btoa(binary));
return window.btoa(binary);
}
function changeBtnStatus(status) {
btnStatus = status;
if (status === "CONNECTING") {
btnControl.innerText = "建立连接中";
} else if (status === "OPEN") {
btnControl.innerText = "录音中...";
} else if (status === "CLOSING") {
btnControl.innerText = "关闭连接中";
} else if (status === "CLOSED") {
btnControl.innerText = "开始录音";
}
}
function renderResult(resultData) {
// 识别结束
let jsonData = JSON.parse(resultData);
// console.log(jsonData.data);
if (jsonData.data && jsonData.data.data) {
let data = window.atob(jsonData.data.data);
let grade = parser.parse(data, {
attributeNamePrefix: "",
ignoreAttributes: false,
});
const readSentence =
grade?.xml_result?.read_sentence?.rec_paper?.read_chapter;
document.getElementById("accuracy_score").innerText =
readSentence?.accuracy_score;
document.getElementById("fluency_score").innerText =
readSentence?.fluency_score;
document.getElementById("integrity_score").innerText =
readSentence?.integrity_score;
document.getElementById("phone_score").innerText =
readSentence?.phone_score || 0;
document.getElementById("tone_score").innerText =
readSentence?.tone_score || 0;
document.getElementById("emotion_score").innerText =
readSentence?.emotion_score || 0;
document.getElementById("total_score").innerText =
readSentence?.total_score;
let sentence = readSentence?.word || [];
let resultStr = "";
sentence.forEach((item) => {
if (item?.word) {
item.word.forEach((wt) => {
let flag = false;
if (wt.syll?.phone) {
flag = wt.syll.phone.some((pt) => pt?.perr_msg != 0);
} else {
wt.syll.forEach((st) => {
if (Array.isArray(st?.phone)) {
flag = st.phone.some((pt) => pt?.perr_msg != 0);
}
});
}
if (flag) {
resultStr += `<span class="err">${wt.content}</span>`;
} else {
resultStr += wt.content;
}
});
} else if (item?.syll) {
let flag = false;
if (item.syll?.phone) {
flag = item.syll.phone.some((pt) => pt?.perr_msg != 0);
} else {
item.syll.forEach((st) => {
if (Array.isArray(st?.phone)) {
flag = st.phone.some((pt) => pt?.perr_msg != 0);
}
});
}
if (flag) {
resultStr += `<span class="err">${item.content}</span>`;
} else {
resultStr += item.content;
}
}
});
if (resultStr) {
document.getElementById("right").style.display = "block";
document.getElementById("result").innerHTML = resultStr;
} else {
document.getElementById("right").style.display = "none";
}
}
if (jsonData.code === 0 && jsonData.data.status === 2) {
iseWS.close();
}
if (jsonData.code !== 0) {
iseWS.close();
console.error(jsonData);
}
}
function connectWebSocket() {
const websocketUrl = getWebSocketUrl();
if ("WebSocket" in window) {
iseWS = new WebSocket(websocketUrl);
} else if ("MozWebSocket" in window) {
iseWS = new MozWebSocket(websocketUrl);
} else {
alert("浏览器不支持WebSocket");
return;
}
changeBtnStatus("CONNECTING");
iseWS.onopen = (e) => {
// 开始录音
recorder.start({
sampleRate: 16000,
frameSize: 1280,
});
var params = {
common: {
app_id: APPID,
},
business: {
category: "read_sentence", // read_syllable/单字朗读,汉语专有 read_word/词语朗读 read_sentence/句子朗读 https://www.xfyun.cn/doc/Ise/IseAPI.html#%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B
rstcd: "utf8",
group: "pupil",
sub: "ise",
tte: "utf-8",
cmd: "ssb",
auf: "audio/L16;rate=16000",
ent: "en_vip",
aus: 1,
aue: "raw",
text:
"\uFEFF" +
(document.getElementById("text")?.value || "where are you"),
},
data: {
status: 0,
// data_type: 1,
// encoding: "raw",
},
};
iseWS.send(JSON.stringify(params));
};
iseWS.onmessage = (e) => {
renderResult(e.data);
};
iseWS.onerror = (e) => {
console.error(e);
recorder.stop();
changeBtnStatus("CLOSED");
};
iseWS.onclose = (e) => {
recorder.stop();
changeBtnStatus("CLOSED");
};
}
recorder.onFrameRecorded = ({ isLastFrame, frameBuffer }) => {
if (iseWS.readyState === iseWS.OPEN) {
console.log(toBase64(frameBuffer))
iseWS.send(
JSON.stringify({
business: {
aue: "raw",
cmd: "auw",
aus: isLastFrame ? 4 : 2,
},
data: {
status: isLastFrame ? 2 : 1,
data: toBase64(frameBuffer),
data_type: 1
},
})
);
if (isLastFrame) {
changeBtnStatus("CLOSING");
}
}
};
recorder.onStop = () => {
};
btnControl.onclick = function () {
console.log('11111111111111111111111');
if (btnStatus === "UNDEFINED" || btnStatus === "CLOSED") {
connectWebSocket();
} else if (btnStatus === "CONNECTING" || btnStatus === "OPEN") {
// 结束录音
recorder.stop();
}
};
})();

256
public/audio/example/md5.js Normal file
View File

@ -0,0 +1,256 @@
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test()
{
return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length
*/
function core_md5(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Calculate the HMAC-MD5, of a key and some data
*/
function core_hmac_md5(key, data)
{
var bkey = str2binl(key);
if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
return core_md5(opad.concat(hash), 512 + 128);
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* Convert a string to an array of little-endian words
* If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
*/
function str2binl(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
return bin;
}
/*
* Convert an array of little-endian words to a string
*/
function binl2str(bin)
{
var str = "";
var mask = (1 << chrsz) - 1;
for(var i = 0; i < bin.length * 32; i += chrsz)
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
return str;
}
/*
* Convert an array of little-endian words to a hex string.
*/
function binl2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
}
return str;
}
/*
* Convert an array of little-endian words to a base-64 string
*/
function binl2b64(binarray)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
for(var i = 0; i < binarray.length * 4; i += 3)
{
var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
}
}
return str;
}

View File

@ -0,0 +1 @@
"use strict";function e(e,t,r,o){return new(r||(r=Promise))((function(n,a){function i(e){try{u(o.next(e))}catch(e){a(e)}}function s(e){try{u(o.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((o=o.apply(e,t||[])).next())}))}function t(e,t){var r,o,n,a,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){i.label=s[1];break}if(6===s[0]&&i.label<n[1]){i.label=n[1],n=s;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(s);break}n[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var r=!AudioWorkletNode;function o(){var e;return(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}):navigator.getUserMedia?new Promise((function(e,t){navigator.getUserMedia({audio:!0,video:!1},(function(t){e(t)}),(function(e){t(e)}))})):Promise.reject(new Error("不支持录音"))}function n(o,n){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return r?[4,o.audioWorklet.addModule("".concat(n,"/processor.worklet.js"))]:[3,2];case 1:return e.sent(),[2,new AudioWorkletNode(o,"processor-worklet")];case 2:return[4,new Worker("".concat(n,"/processor.worker.js"))];case 3:return[2,{port:e.sent()}]}}))}))}var a=function(){function a(e){this.processorPath=e,this.audioBuffers=[]}return a.prototype.start=function(a){var i,s=a.sampleRate,u=a.frameSize,c=a.arrayBufferType;return e(this,void 0,void 0,(function(){var e,a,d,l,f,p;return t(this,(function(t){switch(t.label){case 0:return(e=this).audioBuffers=[],[4,o()];case 1:return a=t.sent(),this.audioTracks=a.getAudioTracks(),d=function(e,t){var r;try{(r=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t})).createMediaStreamSource(e)}catch(t){(r=new(window.AudioContext||window.webkitAudioContext)).createMediaStreamSource(e)}return r}(a,s),this.audioContext=d,d.createMediaStreamSource(a),l=d.createMediaStreamSource(a),[4,n(d,this.processorPath)];case 2:return f=t.sent(),this.audioWorklet=f,f.port.postMessage({type:"init",data:{frameSize:u,toSampleRate:s||d.sampleRate,fromSampleRate:d.sampleRate,arrayBufferType:c||"short16"}}),f.port.onmessage=function(t){u&&e.onFrameRecorded&&e.onFrameRecorded(t.data),e.onStop&&(t.data.frameBuffer&&e.audioBuffers.push(t.data.frameBuffer),t.data.isLastFrame&&!r&&(null==f?void 0:f.port).terminate(),t.data.isLastFrame&&e.onStop(e.audioBuffers))},r?l.connect(f):((p=d.createScriptProcessor(0,1,1)).onaudioprocess=function(e){f.port.postMessage({type:"message",data:e.inputBuffer.getChannelData(0)})},l.connect(p),p.connect(d.destination)),d.resume(),null===(i=this.onStart)||void 0===i||i.call(this),[2]}}))}))},a.prototype.stop=function(){var e,t,r;null===(e=this.audioWorklet)||void 0===e||e.port.postMessage({type:"stop"}),null===(t=this.audioTracks)||void 0===t||t[0].stop(),null===(r=this.audioContext)||void 0===r||r.suspend()},a}();module.exports=a;

30
public/audio/recorder/index.d.ts vendored Normal file
View File

@ -0,0 +1,30 @@
declare class RecorderManager {
/**
*
* @param processorPath processor的文件路径processor.worker.js的访问地址为`/a/b/processor.worker.js`,processorPath `/a/b`
*
*/
constructor(processorPath: string);
private audioBuffers;
private processorPath;
private audioContext?;
private audioTracks?;
private audioWorklet?;
onStop?: (audioBuffers: ArrayBuffer[]) => void;
onFrameRecorded?: (params: {
isLastFrame: boolean;
frameBuffer: ArrayBuffer;
}) => void;
/**
*
*/
onStart?: () => void;
start({ sampleRate, frameSize, arrayBufferType, }: {
sampleRate?: number;
frameSize?: number;
arrayBufferType?: "short16" | "float32";
}): Promise<void>;
stop(): void;
}
export { RecorderManager as default };

View File

@ -0,0 +1 @@
function e(e,t,r,o){return new(r||(r=Promise))((function(n,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function u(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((o=o.apply(e,t||[])).next())}))}function t(e,t){var r,o,n,a,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,o&&(n=2&u[0]?o.return:u[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,u[1])).done)return n;switch(o=0,n&&(u=[2&u[0],n.value]),u[0]){case 0:case 1:n=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3])){i.label=u[1];break}if(6===u[0]&&i.label<n[1]){i.label=n[1],n=u;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(u);break}n[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{r=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}var r=!AudioWorkletNode;function o(){var e;return(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}):navigator.getUserMedia?new Promise((function(e,t){navigator.getUserMedia({audio:!0,video:!1},(function(t){e(t)}),(function(e){t(e)}))})):Promise.reject(new Error("不支持录音"))}function n(o,n){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return r?[4,o.audioWorklet.addModule("".concat(n,"/processor.worklet.js"))]:[3,2];case 1:return e.sent(),[2,new AudioWorkletNode(o,"processor-worklet")];case 2:return[4,new Worker("".concat(n,"/processor.worker.js"))];case 3:return[2,{port:e.sent()}]}}))}))}var a=function(){function a(e){this.processorPath=e,this.audioBuffers=[]}return a.prototype.start=function(a){var i,u=a.sampleRate,s=a.frameSize,c=a.arrayBufferType;return e(this,void 0,void 0,(function(){var e,a,d,l,f,p;return t(this,(function(t){switch(t.label){case 0:return(e=this).audioBuffers=[],[4,o()];case 1:return a=t.sent(),this.audioTracks=a.getAudioTracks(),d=function(e,t){var r;try{(r=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t})).createMediaStreamSource(e)}catch(t){(r=new(window.AudioContext||window.webkitAudioContext)).createMediaStreamSource(e)}return r}(a,u),this.audioContext=d,d.createMediaStreamSource(a),l=d.createMediaStreamSource(a),[4,n(d,this.processorPath)];case 2:return f=t.sent(),this.audioWorklet=f,f.port.postMessage({type:"init",data:{frameSize:s,toSampleRate:u||d.sampleRate,fromSampleRate:d.sampleRate,arrayBufferType:c||"short16"}}),f.port.onmessage=function(t){s&&e.onFrameRecorded&&e.onFrameRecorded(t.data),e.onStop&&(t.data.frameBuffer&&e.audioBuffers.push(t.data.frameBuffer),t.data.isLastFrame&&!r&&(null==f?void 0:f.port).terminate(),t.data.isLastFrame&&e.onStop(e.audioBuffers))},r?l.connect(f):((p=d.createScriptProcessor(0,1,1)).onaudioprocess=function(e){f.port.postMessage({type:"message",data:e.inputBuffer.getChannelData(0)})},l.connect(p),p.connect(d.destination)),d.resume(),null===(i=this.onStart)||void 0===i||i.call(this),[2]}}))}))},a.prototype.stop=function(){var e,t,r;null===(e=this.audioWorklet)||void 0===e||e.port.postMessage({type:"stop"}),null===(t=this.audioTracks)||void 0===t||t[0].stop(),null===(r=this.audioContext)||void 0===r||r.suspend()},a}();export{a as default};

View File

@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).RecorderManager=t()}(this,(function(){"use strict";function e(e,t,r,o){return new(r||(r=Promise))((function(n,a){function i(e){try{u(o.next(e))}catch(e){a(e)}}function s(e){try{u(o.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((o=o.apply(e,t||[])).next())}))}function t(e,t){var r,o,n,a,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){i.label=s[1];break}if(6===s[0]&&i.label<n[1]){i.label=n[1],n=s;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(s);break}n[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function r(){var e,t=navigator,r=t.getUserMedia||t.webkitGetUserMedia||t.mozGetUserMedia;return(null===(e=t.mediaDevices)||void 0===e?void 0:e.getUserMedia)?t.mediaDevices.getUserMedia({audio:!0,video:!1}):r?new Promise((function(e,t){r.call(navigator,{audio:!0,video:!1},(function(t){e(t)}),(function(e){t(e)}))})):Promise.reject(new Error("不支持录音"))}var o;function n(r,n){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[3,2];case 1:return t.sent(),[2,new AudioWorkletNode(r,"processor-worklet")];case 2:return(e=o)?[3,4]:[4,new Worker("".concat(n,"/processor.worker.js"))];case 3:e=t.sent(),t.label=4;case 4:return[2,{port:o=e}]}}))}))}return function(){function o(e){this.processorPath=e,this.audioBuffers=[]}return o.prototype.start=function(o){var a,i=o.sampleRate,s=o.frameSize,u=o.arrayBufferType;return e(this,void 0,void 0,(function(){var e,o,c,l,f,d,p;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),(e=this).audioBuffers=[],[4,r()];case 1:return o=t.sent(),this.audioTracks=o.getAudioTracks(),c=function(e,t){var r;try{(r=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t})).createMediaStreamSource(e)}catch(t){null==r||r.close(),(r=new(window.AudioContext||window.webkitAudioContext)).createMediaStreamSource(e)}return r}(o,i),this.audioContext=c,l=c.createMediaStreamSource(o),[4,n(c,this.processorPath)];case 2:return f=t.sent(),this.audioWorklet=f,f.port.postMessage({type:"init",data:{frameSize:s,toSampleRate:i||c.sampleRate,fromSampleRate:c.sampleRate,arrayBufferType:u||"short16"}}),f.port.onmessage=function(t){var r=t.data,o=r.frameBuffer,n=r.isLastFrame;if(s&&e.onFrameRecorded)if(null==o?void 0:o.byteLength)for(var a=0;a<o.byteLength;)e.onFrameRecorded({isLastFrame:n&&a+s>=o.byteLength,frameBuffer:t.data.frameBuffer.slice(a,a+s)}),a+=s;else e.onFrameRecorded(t.data);e.onStop&&(o&&e.audioBuffers.push(o),n&&e.onStop(e.audioBuffers))},(d=c.createScriptProcessor(0,1,1)).onaudioprocess=function(e){f.port.postMessage({type:"message",data:e.inputBuffer.getChannelData(0)})},l.connect(d),d.connect(c.destination),c.resume(),null===(a=this.onStart)||void 0===a||a.call(this),[3,4];case 3:return p=t.sent(),console.error(p),[3,4];case 4:return[2]}}))}))},o.prototype.stop=function(){var e,t,r,o;null===(e=this.audioWorklet)||void 0===e||e.port.postMessage({type:"stop"}),null===(t=this.audioTracks)||void 0===t||t[0].stop(),"running"===(null===(r=this.audioContext)||void 0===r?void 0:r.state)&&(null===(o=this.audioContext)||void 0===o||o.close())},o}()}));

View File

@ -0,0 +1 @@
!function(){"use strict";function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return e(t,r)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function r(t,e,r,i){this.fromSampleRate=t,this.toSampleRate=e,this.channels=0|r,this.noReturn=!!i,this.initialize()}r.prototype.initialize=function(){if(!(this.fromSampleRate>0&&this.toSampleRate>0&&this.channels>0))throw new Error("Invalid settings specified for the resampler.");this.fromSampleRate==this.toSampleRate?(this.resampler=this.bypassResampler,this.ratioWeight=1):(this.fromSampleRate<this.toSampleRate?(this.lastWeight=1,this.resampler=this.compileLinearInterpolation):(this.tailExists=!1,this.lastWeight=0,this.resampler=this.compileMultiTap),this.ratioWeight=this.fromSampleRate/this.toSampleRate)},r.prototype.compileLinearInterpolation=function(t){var e=t.length;this.initializeBuffers(e);var r,i,s=this.outputBufferSize,a=this.ratioWeight,f=this.lastWeight,n=0,o=0,h=0,l=this.outputBuffer;if(e%this.channels==0){if(e>0){for(;f<1;f+=a)for(n=1-(o=f%1),r=0;r<this.channels;++r)l[h++]=this.lastOutput[r]*n+t[r]*o;for(f--,e-=this.channels,i=Math.floor(f)*this.channels;h<s&&i<e;){for(n=1-(o=f%1),r=0;r<this.channels;++r)l[h++]=t[i+r]*n+t[i+this.channels+r]*o;f+=a,i=Math.floor(f)*this.channels}for(r=0;r<this.channels;++r)this.lastOutput[r]=t[i++];return this.lastWeight=f%1,this.bufferSlice(h)}return this.noReturn?0:[]}throw new Error("Buffer was of incorrect sample length.")},r.prototype.compileMultiTap=function(t){var e=[],r=t.length;this.initializeBuffers(r);var i=this.outputBufferSize;if(r%this.channels==0){if(r>0){for(var s=this.ratioWeight,a=0,f=0;f<this.channels;++f)e[f]=0;var n=0,o=0,h=!this.tailExists;this.tailExists=!1;var l=this.outputBuffer,u=0,p=0;do{if(h)for(a=s,f=0;f<this.channels;++f)e[f]=0;else{for(a=this.lastWeight,f=0;f<this.channels;++f)e[f]+=this.lastOutput[f];h=!0}for(;a>0&&n<r;){if(!(a>=(o=1+n-p))){for(f=0;f<this.channels;++f)e[f]+=t[n+f]*a;p+=a,a=0;break}for(f=0;f<this.channels;++f)e[f]+=t[n++]*o;p=n,a-=o}if(0!=a){for(this.lastWeight=a,f=0;f<this.channels;++f)this.lastOutput[f]=e[f];this.tailExists=!0;break}for(f=0;f<this.channels;++f)l[u++]=e[f]/s}while(n<r&&u<i);return this.bufferSlice(u)}return this.noReturn?0:[]}throw new Error("Buffer was of incorrect sample length.")},r.prototype.bypassResampler=function(t){return this.noReturn?(this.outputBuffer=t,t.length):t},r.prototype.bufferSlice=function(t){if(this.noReturn)return t;try{return this.outputBuffer.subarray(0,t)}catch(e){try{return this.outputBuffer.length=t,this.outputBuffer}catch(e){return this.outputBuffer.slice(0,t)}}},r.prototype.initializeBuffers=function(t){this.outputBufferSize=Math.ceil(t*this.toSampleRate/this.fromSampleRate);try{this.outputBuffer=new Float32Array(this.outputBufferSize),this.lastOutput=new Float32Array(this.channels)}catch(t){this.outputBuffer=[],this.lastOutput=[]}},self.transData=function(t){return"short16"===self.arrayBufferType&&(t=function(t){for(var e=new ArrayBuffer(2*t.length),r=new DataView(e),i=0,s=0;s<t.length;s+=1,i+=2){var a=Math.max(-1,Math.min(1,t[s]));r.setInt16(i,a<0?32768*a:32767*a,!0)}return r.buffer}(t=self.resampler.resampler(t))),t},self.onmessage=function(e){var i=e.data,s=i.type,a=i.data;if("init"===s){var f=a.frameSize,n=a.toSampleRate,o=a.fromSampleRate,h=a.arrayBufferType;return self.frameSize=f*Math.floor(o/n),self.resampler=new r(o,n,1),self.frameBuffer=[],void(self.arrayBufferType=h)}if("stop"===s&&(self.postMessage({frameBuffer:self.transData(self.frameBuffer),isLastFrame:!0}),self.frameBuffer=[]),"message"===s){var l,u=a;if(self.frameSize)return(l=self.frameBuffer).push.apply(l,t(u)),self.frameBuffer.length>=self.frameSize&&(self.postMessage({frameBuffer:self.transData(this.frameBuffer),isLastFrame:!1}),self.frameBuffer=[]),!0;u&&self.postMessage({frameBuffer:self.transData(u),isLastFrame:!1})}}}();

File diff suppressed because one or more lines are too long

View File

@ -5,13 +5,45 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- <link rel="https://axdbook.zxkedu.com/bundles/app/images/zwsjimg2_06.png"> -->
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<title>电子书阅读器</title>
<title>数字教材</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<!-- 以下代码请放入前端html文件的body内 -->
<script src="https://agi-dev-platform-web.bj.bcebos.com/ai_apaas/embed/output/embedLiteSDK.js?responseExpires=0"></script>
<script>
// window.baiduAi = new EmbedLiteSDK({appId: '44425659-f566-4841-a55c-26ade9813ac7', code: 'embedfUR9k5TmycTg2rnWTiqv'});
</script>
<script src="./audio/example/fast-xml-parser.min.js"></script>
<script src="./audio/example/crypto-js.js"></script>
<script src="./audio/recorder/index.umd.js"></script>
<script src="./marked.min.js"></script>
<script>
setFavion = () => {
var link = document.querySelector("link[rel*='icon']")
// <link rel="icon" href="https://axdbook.zxkedu.com/bundles/app/images/zwsjimg2_06.png">
if (window.location.hostname.includes("axdbook")
||window.location.hostname.includes("zyxdbook")
||window.location.hostname.includes("local")
){
// if (window.location.hostname.includes("local")){
// document.title = "电子书阅读"
link.href = "../favicon.ico"
console.log(window.location.hostname)
}
}
setFavion()
</script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>

6
public/marked.min.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><link rel="icon" href="favicon.ico"><title>开放云书院</title><script src="./jquery-1.8.3.min.js"></script><script defer="defer" src="js/chunk-vendors.9aae0e0a.js"></script><script defer="defer" src="js/app.c749bd89.js"></script></head><body><noscript><strong>We're sorry but xml_reader doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(self["webpackChunkxml_reader"]=self["webpackChunkxml_reader"]||[]).push([[543],{8387:function(o,e,i){"use strict";i.r(e);var n=i(8081),t=i.n(n),r=i(3645),a=i.n(r),l=a()(t());l.push([o.id,".index-box[data-v-61ba4ca2]{width:100%}",""]),e["default"]=l},543:function(o,e,i){"use strict";i.r(e),i.d(e,{default:function(){return k}});var n=i(6252),t={class:"index-box"},r={key:0},a={key:1};function l(o,e,i,l,s,d){var c=(0,n.up)("xml-epub-read-pc"),u=(0,n.up)("xml-epub-read");return(0,n.wg)(),(0,n.iD)("div",t,[o.bookInfo.innerWidth>=1e3?((0,n.wg)(),(0,n.iD)("div",r,[(0,n.Wm)(c,{fileId:o.bookInfo.goodsFileId,bookPath:o.bookInfo.bookPath,location:o.bookInfo.location,notesList:o.notesList,sourceList:o.sourceList,luminance:o.bookInfo.luminance,isNote:o.bookInfo.isNote,limitSize:o.bookInfo.limitSize,innerHeight:o.bookInfo.innerHeight,innerWidth:o.bookInfo.innerWidth,integralBox:o.integralBox},null,8,["fileId","bookPath","location","notesList","sourceList","luminance","isNote","limitSize","innerHeight","innerWidth","integralBox"])])):(0,n.kq)("",!0),o.bookInfo.innerWidth<1e3?((0,n.wg)(),(0,n.iD)("div",a,[(0,n.Wm)(u,{fileId:o.bookInfo.goodsFileId,bookPath:o.bookInfo.bookPath,location:o.bookInfo.location,flow:o.bookInfo.flow,notesList:o.notesList,sourceList:o.sourceList,luminance:o.bookInfo.luminance,isNote:o.bookInfo.isNote,limitSize:o.bookInfo.limitSize,innerHeight:o.bookInfo.innerHeight,innerWidth:o.bookInfo.innerWidth,integralBox:o.integralBox},null,8,["fileId","bookPath","location","flow","notesList","sourceList","luminance","isNote","limitSize","innerHeight","innerWidth","integralBox"])])):(0,n.kq)("",!0)])}var s=i(655),d=i(2262),c=i(2201),u=(0,n.aZ)({name:"Index",setup:function(){var o=(0,d.qj)({notesList:[],sourceList:[],TimeParameter:10,integralBox:!1,integral:15,width:22}),e=(0,c.tv)().currentRoute.value.query;console.log(e),e.token&&localStorage.setItem("Gk-Read-Token",e.token);var i={bookPath:e.bookPath||"https://ouchn-prod-public.oss-cn-beijing.aliyuncs.com/goods_file/beea6394-0553-4b53-8738-6ad2847f187f.epub",location:e.location||"0",fileType:e.fileType||"epub",goodsFileId:e.goodsFileId||"",goodsId:e.goodsId||"",relevanceId:e.relevanceId||"",resource:e.resource||"",resourceType:e.resourceType||"",teachInstId:e.teachInstId||"",limitSize:Number(e.limitSize)||100,innerHeight:Number(e.innerHeight)||window.innerHeight,innerWidth:Number(e.innerWidth)||window.innerWidth,luminance:e.luminance||"luminance",isNote:e.isNote||"no",flow:e.flow||"scrolled"};return(0,n.bv)((function(){})),(0,s.pi)({data:o,bookInfo:i},(0,d.BK)(o))}}),b=(i(8344),i(3744));const f=(0,b.Z)(u,[["render",l],["__scopeId","data-v-61ba4ca2"]]);var k=f},8344:function(o,e,i){var n=i(8387);n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[o.id,n,""]]),n.locals&&(o.exports=n.locals);var t=i(4402).Z;t("5ca1913b",n,!0,{sourceMap:!1,shadowMode:!1})}}]);
//# sourceMappingURL=543.e711072f.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

55421
public/static/pdfjs/build/pdf.worker.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEáCNS2-H

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More