File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
ui/src/components/ai-chat/component/operation-button Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ class AudioManage {
293293 const newTextList = textList .slice (this .textList .length )
294294 // 没有新增段落
295295 if (newTextList .length <= 0 ) {
296- return
296+ return 0
297297 }
298298 newTextList .forEach ((text , index ) => {
299299 this .textList .push (text )
@@ -429,7 +429,10 @@ class AudioManage {
429429 }
430430 if (text ) {
431431 const textList = this .getTextList (text , is_end ? true : false )
432- this .appendTextList (textList )
432+ if (this .appendTextList (textList ) !== 0 ) {
433+ // 没有新增段落
434+ return
435+ }
433436 }
434437 // 如果存在在阅读的元素则直接返回
435438 if (this .statusList .some ((item ) => [AudioStatus .PLAY_INT ].includes (item ))) {
@@ -472,7 +475,7 @@ class AudioManage {
472475 setTimeout (() => {
473476 speechSynthesis .speak (audioElement )
474477 this .statusList [index ] = AudioStatus .PLAY_INT
475- }, 100 )
478+ }, 500 )
476479 }
477480 }
478481 }
@@ -533,7 +536,7 @@ onMounted(() => {
533536 const record_id = data .record_id
534537 bus .emit (' play:pause' , record_id )
535538 if (props .data .record_id == record_id ) {
536- if (props .tts && props .tts_autoplay ) {
539+ if (props .tts && props .tts_autoplay && data . is_end ) {
537540 if (audioManage .value ) {
538541 audioManage .value .play (props .data .answer_text , data .is_end )
539542 }
You can’t perform that action at this time.
0 commit comments