|
@@ -309,7 +309,8 @@ export default {
|
|
|
iiframe.contentWindow.testdoContinuousPronunciationAssessment();
|
|
|
// 录音开始
|
|
|
let flag = true;
|
|
|
- iiframe.contentWindow.onRecognizing = e => {
|
|
|
+ iiframe.contentWindow.onRecognizing = (e, recognitionEventArgs) => {
|
|
|
+ var result = recognitionEventArgs.result;
|
|
|
// let e = {
|
|
|
// privText:"测试测试"
|
|
|
// }
|
|
@@ -319,14 +320,16 @@ export default {
|
|
|
flag = false;
|
|
|
this.uploadFileLoading = false;
|
|
|
}
|
|
|
- let privText = e.privText;
|
|
|
+ // let privText = e.privText;
|
|
|
+ let privText = result.text;
|
|
|
if (privText == undefined || privText == "undefined") return;
|
|
|
console.log("👇转译对象👇");
|
|
|
console.log(e);
|
|
|
console.log("👇转译结果👇");
|
|
|
console.log(privText);
|
|
|
this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
|
|
|
- this.videoText += privText;
|
|
|
+ // this.videoText += privText;
|
|
|
+ this.videoText = this.videoText.replace(/(^|[\r\n]+).*?\[\.\.\.\][\r\n]+/, `${privText} [...]\r\n`);
|
|
|
// 将textarea滚动到最底部
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.videoTextTextarea.scrollTop = this.$refs.videoTextTextarea.scrollHeight;
|
|
@@ -535,21 +538,26 @@ export default {
|
|
|
// 录音开始
|
|
|
let flag = true;
|
|
|
// 录音开始
|
|
|
- iiframe.contentWindow.onRecognizing = e => {
|
|
|
+ iiframe.contentWindow.onRecognizing = (e, recognitionEventArgs) => {
|
|
|
+ var result = recognitionEventArgs.result;
|
|
|
+
|
|
|
this.recordedForm.endTime = this.recordedForm.timeDuration;
|
|
|
+
|
|
|
if (flag) {
|
|
|
this.controlsStatus = 1;
|
|
|
flag = false;
|
|
|
this.uploadFileLoading = false;
|
|
|
}
|
|
|
- let privText = e.privText;
|
|
|
+ // let privText = e.privText;
|
|
|
+ let privText = result.text;
|
|
|
if (privText == undefined || privText == "undefined") return;
|
|
|
console.log("👇转译对象👇");
|
|
|
console.log(e);
|
|
|
console.log("👇转译结果👇");
|
|
|
console.log(privText);
|
|
|
this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
|
|
|
- this.videoText += privText;
|
|
|
+ // this.videoText += privText;
|
|
|
+ this.videoText = this.videoText.replace(/(^|[\r\n]+).*?\[\.\.\.\][\r\n]+/, `${privText} [...]\r\n`);
|
|
|
// 将textarea滚动到最底部
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.videoTextTextarea.scrollTop = this.$refs.videoTextTextarea.scrollHeight;
|