-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
@@ -78,11 +86,11 @@
type: "wav", bitRate: 16, sampleRate: 16000
, onProcess: function (buffers, powerLevel, bufferDuration, bufferSampleRate, newBufferIdx, asyncEnd) {
//录音实时回调,大约1秒调用12次本回调
- document.querySelector(".recpowerx").style.width = powerLevel + "%";
- document.querySelector(".recpowert").innerText = bufferDuration + " / " + powerLevel;
+ // document.querySelector(".recpowerx").style.width = powerLevel + "%";
+ // document.querySelector(".recpowert").innerText = bufferDuration + " / " + powerLevel;
//可视化图形绘制
- wave.input(buffers[buffers.length - 1], powerLevel, bufferSampleRate);
+ // wave.input(buffers[buffers.length - 1], powerLevel, bufferSampleRate);
}
});
@@ -93,7 +101,7 @@
rec = newRec;
//此处创建这些音频可视化图形绘制浏览器支持妥妥的
- wave = Recorder.FrequencyHistogramView({ elem: ".recwave" });
+ // wave = Recorder.FrequencyHistogramView({ elem: ".recwave" });
reclog("已打开录音,可以点击录制开始录音了", 2);
}, function (msg, isUserNotAllow) {//用户拒绝未授权或不支持
@@ -194,7 +202,7 @@
//本例子假设使用原始XMLHttpRequest请求方式,实际使用中自行调整为自己的请求方式
//录音结束时拿到了blob文件对象,可以用FileReader读取出内容,或者用FormData上传
- var api = "http://127.0.0.1:8080/api/synthesize";
+ var api = "/api/synthesize";
reclog("开始上传到" + api + ",请求稍后...");
@@ -277,7 +285,7 @@
var div = document.createElement("div");
var elem = document.querySelector(".reclog");
elem.insertBefore(div, elem.firstChild);
- div.innerHTML = '
[' + t + ']' + s + '
';
+ div.innerHTML = '
[' + t + ']' + s + '
';
};
window.onerror = function (message, url, lineNo, columnNo, error) {
reclog('
【Uncaught Error】' + message + '' + "at:" + lineNo + ":" + columnNo + " url:" + url + "\n" + (error && error.stack || "不能获得错误堆栈") + '
');
@@ -312,11 +320,11 @@
a {
text-decoration: none;
- color: #FE76B8;
+ color: #327de8;
}
a:hover {
- color: #f00;
+ color: #5da1f5;
}
.main {
@@ -330,7 +338,7 @@
padding: 12px;
border-radius: 6px;
background: #fff;
- --border: 1px solid #f60;
+ --border: 1px solid #327de8;
box-shadow: 2px 2px 3px #aaa;
}
@@ -340,10 +348,11 @@
cursor: pointer;
border: none;
border-radius: 3px;
- background: #FE76B8;
+ background: #327de8;
color: #fff;
padding: 0 15px;
- margin: 3px 20px 3px 0;
+ margin: 3px 10px 3px 0;
+ width: 70px;
line-height: 36px;
height: 36px;
overflow: hidden;
@@ -351,9 +360,12 @@
}
.btns button:active {
- background: #fd54a6
+ background: #5da1f5
}
+ .btns button:hover {
+ background: #5da1f5
+ }
.pd {
padding: 0 0 6px 0;
}
@@ -361,7 +373,7 @@
.lb {
display: inline-block;
vertical-align: middle;
- background: #ff3d9b;
+ background: #327de8;
color: #fff;
font-size: 14px;
padding: 2px 8px;