Browse Source

调整清空用户语言清空时机

zhuf 1 year ago
parent
commit
1267f54f42
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/pages/caiji/sy/record/[id].vue

+ 3 - 2
src/pages/caiji/sy/record/[id].vue

@@ -241,7 +241,7 @@ function submitAudio() {
       const audioBlob = new Blob(audioChunks, { type: 'audio/wav' });
       const filedata = new File([audioBlob], 'audio.wav', { type: 'audio/wav' });
       mediaRecorder = null
-      audioChunks = []
+      // audioChunks = []
       request({
         url: '/aimooc/xnszr_audio/detect_audio',
         data: {
@@ -260,6 +260,7 @@ function submitAudio() {
         .then((res: any) => {
           console.log('声音采集识别结果 : ', res)
           if (res?.code === '1') {
+            audioChunks = []
             console.log('声音采集识别成功 当前读到: ', current.value + 1)
             if (current.value === list.value.length - 1) {
               handleSubmitTask()
@@ -315,4 +316,4 @@ function submitAudio() {
 
   </div>
   <!-- <audio ref="audio"></audio> -->
-</template>
+</template>