Skip to content

Commit 18fa066

Browse files
committed
refactor: Cancel last autoplay audio
--story=1017953 --user=刘瑞斌 【优化】多轮对话,语音识别自动播放,会重叠播放 https://www.tapd.cn/57709429/s/1660001
1 parent 54ebfc3 commit 18fa066

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ui/src/components/ai-chat/component/operation-button/ChatOperationButton.vue

+6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import applicationApi from '@/api/application'
8686
import { datetimeFormat } from '@/utils/time'
8787
import { MsgError } from '@/utils/message'
8888
import { t } from '@/locales'
89+
import bus from '@/bus'
8990
const route = useRoute()
9091
const {
9192
params: { id }
@@ -277,6 +278,11 @@ const pausePlayAnswerText = () => {
277278
}
278279
279280
onMounted(() => {
281+
bus.on('pause-autoplay', () => {
282+
pausePlayAnswerText()
283+
// console.log(1234)
284+
})
285+
bus.emit('pause-autoplay')
280286
// 第一次回答后自动播放, 打开历史记录不自动播放
281287
if (props.tts && props.tts_autoplay && buttonData.value.write_ed && !buttonData.value.update_time) {
282288
playAnswerText(buttonData.value.answer_text)

0 commit comments

Comments
 (0)