|
@@ -3134,7 +3134,10 @@ ${JSON.stringify(_list)}
|
|
|
}
|
|
|
this.showGetTextLoading = true;
|
|
|
let privText = e.privText;
|
|
|
- if (privText == undefined || privText == "undefined") return;
|
|
|
+ let _copyPrivSpeakerId = privSpeakerId;
|
|
|
+ if (!privText || !privSpeakerId || privSpeakerId == "Unknown") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
console.log("👇转译对象👇");
|
|
|
console.log(e);
|
|
|
console.log("👇转译结果👇");
|
|
@@ -3154,7 +3157,7 @@ ${JSON.stringify(_list)}
|
|
|
};
|
|
|
this.recordedForm.textList.push(newItem);
|
|
|
this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
|
|
|
- this.transcriptionData.content += privText;
|
|
|
+ this.transcriptionData.content += _copyPrivSpeakerId + ":" + privText + "\n";
|
|
|
this.onRecordAddLine(newItem);
|
|
|
};
|
|
|
|
|
@@ -3164,59 +3167,63 @@ ${JSON.stringify(_list)}
|
|
|
let _resolve;
|
|
|
const p = new Promise(resolve => (_resolve = resolve));
|
|
|
let iiframe = this.$refs["iiframe"];
|
|
|
- iiframe.contentWindow.window.document
|
|
|
- .getElementById("scenarioStopButton")
|
|
|
- .click();
|
|
|
- // 录音借宿
|
|
|
- iiframe.contentWindow.onSessionStopped = (s, e) => {
|
|
|
- this.recordedForm.status = 2;
|
|
|
- this.$message.success("已停止录音");
|
|
|
- console.log("停止录音👇");
|
|
|
- console.log("停止录音", e);
|
|
|
- this.recordedForm.audioBlob.push(e.preaudio);
|
|
|
- iiframe.contentWindow.onSessionStopped = null;
|
|
|
- iiframe.contentWindow.onRecognizedResult = null;
|
|
|
- _resolve();
|
|
|
- };
|
|
|
+ iiframe.contentWindow.audioConfig.privSource.privContext.suspend();
|
|
|
+ _resolve();
|
|
|
+ // iiframe.contentWindow.window.document
|
|
|
+ // .getElementById("scenarioStopButton")
|
|
|
+ // .click();
|
|
|
+ // // 录音借宿
|
|
|
+ // iiframe.contentWindow.onSessionStopped = (s, e) => {
|
|
|
+ // this.recordedForm.status = 2;
|
|
|
+ // this.$message.success("已停止录音");
|
|
|
+ // console.log("停止录音👇");
|
|
|
+ // console.log("停止录音", e);
|
|
|
+ // this.recordedForm.audioBlob.push(e.preaudio);
|
|
|
+ // iiframe.contentWindow.onSessionStopped = null;
|
|
|
+ // iiframe.contentWindow.onRecognizedResult = null;
|
|
|
+ // _resolve();
|
|
|
+ // };
|
|
|
+
|
|
|
return p;
|
|
|
},
|
|
|
onContinueRecordWithMicrosoft() {
|
|
|
let iiframe = this.$refs["iiframe"];
|
|
|
- iiframe.contentWindow.window.document.getElementById(
|
|
|
- "languageOptions"
|
|
|
- ).selectedIndex = this.languageRadio;
|
|
|
+ // iiframe.contentWindow.window.document.getElementById(
|
|
|
+ // "languageOptions"
|
|
|
+ // ).selectedIndex = this.languageRadio;
|
|
|
// iiframe.contentWindow.testdoContinuousPronunciationAssessment();
|
|
|
-
|
|
|
+ iiframe.contentWindow.audioConfig.privSource.privContext.resume();
|
|
|
// 录音开始
|
|
|
- iiframe.contentWindow.onRecognizedResult = e => {
|
|
|
- this.recordedForm.endTime = this.recordedForm.timeDuration;
|
|
|
- this.showGetTextLoading = true;
|
|
|
- let privText = e.privText;
|
|
|
- if (privText == undefined || privText == "undefined") return;
|
|
|
- console.log("👇转译对象👇");
|
|
|
- console.log(e);
|
|
|
- console.log("👇转译结果👇");
|
|
|
- console.log(privText);
|
|
|
- const newItem = {
|
|
|
- value: privText,
|
|
|
- role: "",
|
|
|
- startTime: this.updateRecordedTime({
|
|
|
- duration: this.recordedForm.startTime
|
|
|
- }),
|
|
|
- endTime: this.updateRecordedTime({
|
|
|
- duration: this.recordedForm.endTime
|
|
|
- }),
|
|
|
- time: this.updateRecordedTime({
|
|
|
- duration: this.recordedForm.endTime - this.recordedForm.startTime
|
|
|
- })
|
|
|
- };
|
|
|
- this.recordedForm.textList.push(newItem);
|
|
|
- this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
|
|
|
- this.transcriptionData.content += privText;
|
|
|
- this.onRecordAddLine(newItem);
|
|
|
- };
|
|
|
-
|
|
|
- iiframe.contentWindow.ConversationTranscriber();
|
|
|
+ // iiframe.contentWindow.onRecognizedResult = e => {
|
|
|
+ // this.recordedForm.endTime = this.recordedForm.timeDuration;
|
|
|
+ // this.showGetTextLoading = true;
|
|
|
+ // let privText = e.privText;
|
|
|
+ // let _copyPrivSpeakerId = privSpeakerId;
|
|
|
+ // if (privText == undefined || privText == "undefined") return;
|
|
|
+ // console.log("👇转译对象👇");
|
|
|
+ // console.log(e);
|
|
|
+ // console.log("👇转译结果👇");
|
|
|
+ // console.log(privText);
|
|
|
+ // const newItem = {
|
|
|
+ // value: privText,
|
|
|
+ // role: "",
|
|
|
+ // startTime: this.updateRecordedTime({
|
|
|
+ // duration: this.recordedForm.startTime
|
|
|
+ // }),
|
|
|
+ // endTime: this.updateRecordedTime({
|
|
|
+ // duration: this.recordedForm.endTime
|
|
|
+ // }),
|
|
|
+ // time: this.updateRecordedTime({
|
|
|
+ // duration: this.recordedForm.endTime - this.recordedForm.startTime
|
|
|
+ // })
|
|
|
+ // };
|
|
|
+ // this.recordedForm.textList.push(newItem);
|
|
|
+ // this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
|
|
|
+ // this.transcriptionData.content += _copyPrivSpeakerId + ":" + privText + "\n";
|
|
|
+ // this.onRecordAddLine(newItem);
|
|
|
+ // };
|
|
|
+
|
|
|
+ // iiframe.contentWindow.ConversationTranscriber();
|
|
|
},
|
|
|
onFinishRecordWithMicrosoft() {
|
|
|
if (this.recordedForm.status == 1) {
|