SanHQin 1 week ago
parent
commit
59962e4155

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.b5dfd0f2d200c52179dce5b4bd68fb4b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.bb486323f0fa002ba2e7.js></script><script type=text/javascript src=./static/js/app.780298b0f3f2d20fce97.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.bb32ea5efb214c504379f99571c08794.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.bb486323f0fa002ba2e7.js></script><script type=text/javascript src=./static/js/app.99b23668052bd88ebb1f.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.bb32ea5efb214c504379f99571c08794.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.bb32ea5efb214c504379f99571c08794.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.99b23668052bd88ebb1f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.99b23668052bd88ebb1f.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.161e82026ac2ae03ab6f.js.map


+ 56 - 49
src/components/pages/classroomObservation/components/chatArea.vue

@@ -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) {

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