@oxiaom/adoremix-linux-arm 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/etc/docroot/bangzhu/css/app.css +5 -5
- package/native/etc/docroot/bangzhu/css/feedback.css +7 -7
- package/native/etc/docroot/bangzhu/css/mui.dtpicker.css +1 -1
- package/native/etc/docroot/bangzhu/css/mui.picker.all.css +4 -4
- package/native/etc/docroot/bangzhu/css/mui.picker.min.css +6 -6
- package/native/etc/docroot/bangzhu/css/mui.poppicker.css +3 -3
- package/native/etc/docroot/bangzhu/examples/actionsheet-plus.html +20 -20
- package/native/etc/docroot/bangzhu/examples/actionsheet.html +6 -6
- package/native/etc/docroot/bangzhu/examples/best-practices/list-to-detail/detail.html +3 -3
- package/native/etc/docroot/bangzhu/examples/card.html +24 -24
- package/native/etc/docroot/bangzhu/examples/im-chat.html +5 -5
- package/native/etc/docroot/bangzhu/examples/media-list.html +49 -49
- package/native/etc/docroot/bangzhu/examples/message-bottom.html +2 -2
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-left-plus-main.html +13 -13
- package/native/etc/docroot/bangzhu/examples/picker.html +2 -2
- package/native/etc/docroot/bangzhu/examples/popovers.html +12 -12
- package/native/etc/docroot/bangzhu/examples/pullrefresh_sub.html +11 -11
- package/native/etc/docroot/bangzhu/examples/slider-default.html +18 -18
- package/native/etc/docroot/bangzhu/examples/tab-webview-subpage-setting.html +3 -3
- package/native/etc/docroot/bangzhu/index.html +413 -413
- package/native/etc/docroot/bangzhu/js/mui.picker.min.js +6 -6
- package/native/etc/docroot/bangzhu/manifest.json +993 -993
- package/native/etc/docroot/luyin2/index.html +144 -144
- package/native/etc/docroot/luyin2/js/jquery-1.10.1.min.js +5 -5
- package/native/etc/docroot/luyin2/js/lame.min.js +307 -307
- package/native/etc/docroot/luyin2/js/recordmp3.js +239 -239
- package/native/etc/docroot/luyin2/js/worker-realtime.js +105 -105
- package/native/etc/docroot/luyin2//346/223/215/344/275/234/346/214/207/345/215/227.txt +2 -2
- package/native/etc/docroot/static/css/app.8421a6d597ba48619941ccd4e386fbb2.css +332 -332
- package/native/etc/docroot/tts.js +150 -150
- package/native/etc/docroot/xcx/devicelist.html +658 -658
- package/native/etc/docroot/xcx/index.html +74 -74
- package/native/etc/docroot/xcx/main.html +84 -84
- package/native/etc/ttys/adore03.sql +426 -426
- package/native/etc/ttys/adore04.sql +426 -426
- package/native/etc/ttys/adore1.sql +859 -859
- package/native/etc/ttys/adore_mix22.sql +806 -806
- package/native/etc/ttys/sqlite.sql +1140 -1140
- package/native/etc/ttys/sqlite3main.sql +434 -434
- package/native/etc/ttys/sqltest.sql +279 -279
- package/native/etc/ttys/tp3sql.sql +1412 -1412
- package/native/find.js +523 -523
- package/native/findsc.js +695 -695
- package/native/tts.js +150 -150
- package/package.json +1 -1
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
/* Created by iflytek on 2020/03/01.
|
|
2
|
-
*
|
|
3
|
-
* 运行前:请先填写 appid、apiSecret、apiKey
|
|
4
|
-
*
|
|
5
|
-
* 在线语音合成调用demo
|
|
6
|
-
* 此demo只是一个简单的调用示例,不适合用到实际生产环境中
|
|
7
|
-
*
|
|
8
|
-
* 在线语音合成 WebAPI 接口调用示例 接口文档(必看):https://www.xfyun.cn/doc/tts/online_tts/API.html
|
|
9
|
-
* 错误码链接:
|
|
10
|
-
* https://www.xfyun.cn/document/error-code (code返回错误码时必看)
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
console.log(module.paths);
|
|
14
|
-
const CryptoJS = require('crypto-js')
|
|
15
|
-
const WebSocket = require('ws')
|
|
16
|
-
var log = require('log4node')
|
|
17
|
-
var fs = require('fs')
|
|
18
|
-
|
|
19
|
-
var arg = process.argv.splice(2);
|
|
20
|
-
let volume = arg[0]
|
|
21
|
-
let speed = arg[1]
|
|
22
|
-
let sex = arg[2]
|
|
23
|
-
let path = arg[3]
|
|
24
|
-
let textpath = arg[4]
|
|
25
|
-
let appid_s = arg[5]
|
|
26
|
-
let apiSecret_s = arg[6]
|
|
27
|
-
let apiKey_s = arg[7]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var text = fs.readFileSync(textpath, 'utf-8');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// 系统配置
|
|
37
|
-
const config = {
|
|
38
|
-
// 请求地址
|
|
39
|
-
hostUrl: "wss://tts-api.xfyun.cn/v2/tts",
|
|
40
|
-
host: "tts-api.xfyun.cn",
|
|
41
|
-
//在控制台-我的应用-在线语音合成(流式版)获取
|
|
42
|
-
//appid: "f88a1005",
|
|
43
|
-
appid: appid_s,
|
|
44
|
-
//在控制台-我的应用-在线语音合成(流式版)获取
|
|
45
|
-
//apiSecret: "NzgwOGRlZjAxYzI0YTNhZDhhYWQ0ZGMz",
|
|
46
|
-
apiSecret: apiSecret_s,
|
|
47
|
-
//在控制台-我的应用-在线语音合成(流式版)获取
|
|
48
|
-
//apiKey: "cd9b9123600a7e0123d38d89187f760f",
|
|
49
|
-
apiKey: apiKey_s,
|
|
50
|
-
text: text,
|
|
51
|
-
uri: "/v2/tts",
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// 获取当前时间 RFC1123格式
|
|
55
|
-
let date = (new Date().toUTCString())
|
|
56
|
-
// 设置当前临时状态为初始化
|
|
57
|
-
|
|
58
|
-
let wssUrl = config.hostUrl + "?authorization=" + getAuthStr(date) + "&date=" + date + "&host=" + config.host
|
|
59
|
-
let ws = new WebSocket(wssUrl)
|
|
60
|
-
|
|
61
|
-
// 连接建立完毕,读取数据进行识别
|
|
62
|
-
ws.on('open', () => {
|
|
63
|
-
log.info("websocket connect!")
|
|
64
|
-
send()
|
|
65
|
-
// 如果之前保存过音频文件,删除之
|
|
66
|
-
if (fs.existsSync('./test.mp3')) {
|
|
67
|
-
fs.unlink('./test.mp3', (err) => {
|
|
68
|
-
if (err) {
|
|
69
|
-
log.error('remove error: ' + err)
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
// 得到结果后进行处理,仅供参考,具体业务具体对待
|
|
76
|
-
ws.on('message', (data, err) => {
|
|
77
|
-
if (err) {
|
|
78
|
-
log.error('message error: ' + err)
|
|
79
|
-
return
|
|
80
|
-
}
|
|
81
|
-
let res = JSON.parse(data)
|
|
82
|
-
if (res.code != 0) {
|
|
83
|
-
log.error(`${res.code}: ${res.message}`)
|
|
84
|
-
ws.close()
|
|
85
|
-
return
|
|
86
|
-
}
|
|
87
|
-
let audio = res.data.audio
|
|
88
|
-
let audioBuf = Buffer.from(audio, 'base64')
|
|
89
|
-
save(audioBuf)
|
|
90
|
-
if (res.code == 0 && res.data.status == 2) {
|
|
91
|
-
ws.close()
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
// 资源释放
|
|
96
|
-
ws.on('close', () => {
|
|
97
|
-
log.info('connect close!')
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
// 连接错误
|
|
101
|
-
ws.on('error', (err) => {
|
|
102
|
-
log.error("websocket connect err: " + err)
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
// 鉴权签名
|
|
106
|
-
function getAuthStr(date) {
|
|
107
|
-
let signatureOrigin = `host: ${config.host}\ndate: ${date}\nGET ${config.uri} HTTP/1.1`
|
|
108
|
-
let signatureSha = CryptoJS.HmacSHA256(signatureOrigin, config.apiSecret)
|
|
109
|
-
let signature = CryptoJS.enc.Base64.stringify(signatureSha)
|
|
110
|
-
let authorizationOrigin = `api_key="${config.apiKey}", algorithm="hmac-sha256", headers="host date request-line", signature="${signature}"`
|
|
111
|
-
let authStr = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(authorizationOrigin))
|
|
112
|
-
return authStr
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 传输数据
|
|
116
|
-
function send() {
|
|
117
|
-
let frame = {
|
|
118
|
-
// 填充common
|
|
119
|
-
"common": {
|
|
120
|
-
"app_id": config.appid
|
|
121
|
-
},
|
|
122
|
-
// 填充business
|
|
123
|
-
"business": {
|
|
124
|
-
"aue": "lame",
|
|
125
|
-
"sfl": 1,
|
|
126
|
-
"volume": parseInt(volume),
|
|
127
|
-
"speed": parseInt(speed),
|
|
128
|
-
// "auf": "audio/L16;rate=16000",
|
|
129
|
-
"vcn": sex,
|
|
130
|
-
"tte": "UTF8" //如果中文播放不正常这里修改为GBK 或者是 UTF8 BIG5 UNICODE 挨个测试
|
|
131
|
-
},
|
|
132
|
-
// 填充data
|
|
133
|
-
"data": {
|
|
134
|
-
"text": Buffer.from(config.text).toString('base64'),
|
|
135
|
-
"status": 2
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
ws.send(JSON.stringify(frame))
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// 保存文件
|
|
142
|
-
function save(data) {
|
|
143
|
-
fs.writeFile('./tty/'+path, data, { flag: 'a' }, (err) => {
|
|
144
|
-
if (err) {
|
|
145
|
-
log.error('save error: ' + err)
|
|
146
|
-
return
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
log.info('文件保存成功')
|
|
150
|
-
})
|
|
1
|
+
/* Created by iflytek on 2020/03/01.
|
|
2
|
+
*
|
|
3
|
+
* 运行前:请先填写 appid、apiSecret、apiKey
|
|
4
|
+
*
|
|
5
|
+
* 在线语音合成调用demo
|
|
6
|
+
* 此demo只是一个简单的调用示例,不适合用到实际生产环境中
|
|
7
|
+
*
|
|
8
|
+
* 在线语音合成 WebAPI 接口调用示例 接口文档(必看):https://www.xfyun.cn/doc/tts/online_tts/API.html
|
|
9
|
+
* 错误码链接:
|
|
10
|
+
* https://www.xfyun.cn/document/error-code (code返回错误码时必看)
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
console.log(module.paths);
|
|
14
|
+
const CryptoJS = require('crypto-js')
|
|
15
|
+
const WebSocket = require('ws')
|
|
16
|
+
var log = require('log4node')
|
|
17
|
+
var fs = require('fs')
|
|
18
|
+
|
|
19
|
+
var arg = process.argv.splice(2);
|
|
20
|
+
let volume = arg[0]
|
|
21
|
+
let speed = arg[1]
|
|
22
|
+
let sex = arg[2]
|
|
23
|
+
let path = arg[3]
|
|
24
|
+
let textpath = arg[4]
|
|
25
|
+
let appid_s = arg[5]
|
|
26
|
+
let apiSecret_s = arg[6]
|
|
27
|
+
let apiKey_s = arg[7]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var text = fs.readFileSync(textpath, 'utf-8');
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// 系统配置
|
|
37
|
+
const config = {
|
|
38
|
+
// 请求地址
|
|
39
|
+
hostUrl: "wss://tts-api.xfyun.cn/v2/tts",
|
|
40
|
+
host: "tts-api.xfyun.cn",
|
|
41
|
+
//在控制台-我的应用-在线语音合成(流式版)获取
|
|
42
|
+
//appid: "f88a1005",
|
|
43
|
+
appid: appid_s,
|
|
44
|
+
//在控制台-我的应用-在线语音合成(流式版)获取
|
|
45
|
+
//apiSecret: "NzgwOGRlZjAxYzI0YTNhZDhhYWQ0ZGMz",
|
|
46
|
+
apiSecret: apiSecret_s,
|
|
47
|
+
//在控制台-我的应用-在线语音合成(流式版)获取
|
|
48
|
+
//apiKey: "cd9b9123600a7e0123d38d89187f760f",
|
|
49
|
+
apiKey: apiKey_s,
|
|
50
|
+
text: text,
|
|
51
|
+
uri: "/v2/tts",
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 获取当前时间 RFC1123格式
|
|
55
|
+
let date = (new Date().toUTCString())
|
|
56
|
+
// 设置当前临时状态为初始化
|
|
57
|
+
|
|
58
|
+
let wssUrl = config.hostUrl + "?authorization=" + getAuthStr(date) + "&date=" + date + "&host=" + config.host
|
|
59
|
+
let ws = new WebSocket(wssUrl)
|
|
60
|
+
|
|
61
|
+
// 连接建立完毕,读取数据进行识别
|
|
62
|
+
ws.on('open', () => {
|
|
63
|
+
log.info("websocket connect!")
|
|
64
|
+
send()
|
|
65
|
+
// 如果之前保存过音频文件,删除之
|
|
66
|
+
if (fs.existsSync('./test.mp3')) {
|
|
67
|
+
fs.unlink('./test.mp3', (err) => {
|
|
68
|
+
if (err) {
|
|
69
|
+
log.error('remove error: ' + err)
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
// 得到结果后进行处理,仅供参考,具体业务具体对待
|
|
76
|
+
ws.on('message', (data, err) => {
|
|
77
|
+
if (err) {
|
|
78
|
+
log.error('message error: ' + err)
|
|
79
|
+
return
|
|
80
|
+
}
|
|
81
|
+
let res = JSON.parse(data)
|
|
82
|
+
if (res.code != 0) {
|
|
83
|
+
log.error(`${res.code}: ${res.message}`)
|
|
84
|
+
ws.close()
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
let audio = res.data.audio
|
|
88
|
+
let audioBuf = Buffer.from(audio, 'base64')
|
|
89
|
+
save(audioBuf)
|
|
90
|
+
if (res.code == 0 && res.data.status == 2) {
|
|
91
|
+
ws.close()
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
// 资源释放
|
|
96
|
+
ws.on('close', () => {
|
|
97
|
+
log.info('connect close!')
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
// 连接错误
|
|
101
|
+
ws.on('error', (err) => {
|
|
102
|
+
log.error("websocket connect err: " + err)
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
// 鉴权签名
|
|
106
|
+
function getAuthStr(date) {
|
|
107
|
+
let signatureOrigin = `host: ${config.host}\ndate: ${date}\nGET ${config.uri} HTTP/1.1`
|
|
108
|
+
let signatureSha = CryptoJS.HmacSHA256(signatureOrigin, config.apiSecret)
|
|
109
|
+
let signature = CryptoJS.enc.Base64.stringify(signatureSha)
|
|
110
|
+
let authorizationOrigin = `api_key="${config.apiKey}", algorithm="hmac-sha256", headers="host date request-line", signature="${signature}"`
|
|
111
|
+
let authStr = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(authorizationOrigin))
|
|
112
|
+
return authStr
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 传输数据
|
|
116
|
+
function send() {
|
|
117
|
+
let frame = {
|
|
118
|
+
// 填充common
|
|
119
|
+
"common": {
|
|
120
|
+
"app_id": config.appid
|
|
121
|
+
},
|
|
122
|
+
// 填充business
|
|
123
|
+
"business": {
|
|
124
|
+
"aue": "lame",
|
|
125
|
+
"sfl": 1,
|
|
126
|
+
"volume": parseInt(volume),
|
|
127
|
+
"speed": parseInt(speed),
|
|
128
|
+
// "auf": "audio/L16;rate=16000",
|
|
129
|
+
"vcn": sex,
|
|
130
|
+
"tte": "UTF8" //如果中文播放不正常这里修改为GBK 或者是 UTF8 BIG5 UNICODE 挨个测试
|
|
131
|
+
},
|
|
132
|
+
// 填充data
|
|
133
|
+
"data": {
|
|
134
|
+
"text": Buffer.from(config.text).toString('base64'),
|
|
135
|
+
"status": 2
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
ws.send(JSON.stringify(frame))
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 保存文件
|
|
142
|
+
function save(data) {
|
|
143
|
+
fs.writeFile('./tty/'+path, data, { flag: 'a' }, (err) => {
|
|
144
|
+
if (err) {
|
|
145
|
+
log.error('save error: ' + err)
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
log.info('文件保存成功')
|
|
150
|
+
})
|
|
151
151
|
}
|