diff --git a/index.js b/index.js index 8fb2c07..acdf285 100644 --- a/index.js +++ b/index.js @@ -214,8 +214,7 @@ function RecordXunfei() { // 重新录制 function reRecordXunfei() { - if (btnStatus === 'CONNECTING' || btnStatus === 'OPEN') { - console.log('重新录制') - connectWebSocket() - } + console.log('重新录制') + + connectWebSocket() } diff --git a/src/views/chat/components/Message/index.vue b/src/views/chat/components/Message/index.vue index 2f69962..db0e4c2 100644 --- a/src/views/chat/components/Message/index.vue +++ b/src/views/chat/components/Message/index.vue @@ -165,12 +165,11 @@ const watchTTS = watch(() => props.tts, async (n: any, o: any) => { // 停止播放音频 const stopPlay = () => { console.log('停止播放音频') - watchTTS() - audioElements.forEach((item: any) => { - item.pause() - item.currentTime = 0 - }) - // audioElements.length = 0 + pauseIndex = -1 + playStatus.value = 'end' + emit('changeNowStatus', 'input') + for (let i = 0; i < audioElements.length; i++) + audioElements[i].pause() } onUpdated(() => {