|
@@ -328,14 +328,9 @@ export default {
|
|
|
console.log("👇转译结果👇");
|
|
|
console.log(privText);
|
|
|
this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
|
|
|
- console.log(
|
|
|
- '赋值前。。。',this.videoText.replace(/(^|[\r\n]+).*?\[\.\.\.\][\r\n]+/, `${privText} [...]\r\n`)
|
|
|
- );
|
|
|
-
|
|
|
- this.videoText += privText;
|
|
|
- console.log(
|
|
|
- '赋值后。。。',this.videoText.replace(/(^|[\r\n]+).*?\[\.\.\.\][\r\n]+/, `${privText} [...]\r\n`)
|
|
|
- );
|
|
|
+ // this.videoText += privText;
|
|
|
+ this.videoText = this.videoText.replace(/(.*?)(^|[\r\n]+).*?\[\.\.\.\][\r\n]+/, '$1$2') + `${result.text} [...]\r\n`;
|
|
|
+
|
|
|
// 将textarea滚动到最底部
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.videoTextTextarea.scrollTop = this.$refs.videoTextTextarea.scrollHeight;
|
|
@@ -373,6 +368,7 @@ export default {
|
|
|
case "microsoft":
|
|
|
this.onPauseRecordWithMicrosoft().then(() => {
|
|
|
this.recordedForm.loading = false;
|
|
|
+ this.videoText = this.videoText.replace(/\[\.\.\.\][\r\n]+/, '')
|
|
|
});
|
|
|
break;
|
|
|
case "shengyang":
|
|
@@ -446,6 +442,7 @@ export default {
|
|
|
let file = new File([blob], "recordedFile.wav", {
|
|
|
type: "audio/wav"
|
|
|
});
|
|
|
+ this.videoText = this.videoText.replace(/\[\.\.\.\][\r\n]+/, '')
|
|
|
this.uploadFile(file, { changeText: false, flag: true });
|
|
|
iiframe.contentWindow.onSessionStopped = null;
|
|
|
iiframe.contentWindow.onRecognizing = null;
|
|
@@ -562,8 +559,8 @@ export default {
|
|
|
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]+/, '$1$2') + `${result.text} [...]\r\n`;
|
|
|
// 将textarea滚动到最底部
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.videoTextTextarea.scrollTop = this.$refs.videoTextTextarea.scrollHeight;
|