mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 21:35:52 +08:00
修复
This commit is contained in:
parent
73209a4f0a
commit
0f55b92f0e
@ -286,7 +286,7 @@ const TTSSettings: FC = () => {
|
|||||||
setAvailableVoices(predefinedVoices)
|
setAvailableVoices(predefinedVoices)
|
||||||
return () => {}
|
return () => {}
|
||||||
}
|
}
|
||||||
}, [])
|
}, [getVoices, predefinedVoices])
|
||||||
|
|
||||||
// 测试TTS功能
|
// 测试TTS功能
|
||||||
const testTTS = async () => {
|
const testTTS = async () => {
|
||||||
|
|||||||
@ -119,19 +119,19 @@ class ASRService {
|
|||||||
console.log('[ASRService] 浏览器断开连接')
|
console.log('[ASRService] 浏览器断开连接')
|
||||||
this.browserReady = false
|
this.browserReady = false
|
||||||
window.message.error({ content: '语音识别浏览器断开连接', key: 'browser-status' })
|
window.message.error({ content: '语音识别浏览器断开连接', key: 'browser-status' })
|
||||||
}
|
} else if (data.message === 'stopped') {
|
||||||
} else if (data.type === 'status' && data.message === 'stopped') {
|
// 语音识别已停止
|
||||||
// 语音识别已停止
|
console.log('[ASRService] 语音识别已停止')
|
||||||
console.log('[ASRService] 语音识别已停止')
|
this.isRecording = false
|
||||||
this.isRecording = false
|
|
||||||
|
|
||||||
// 如果没有收到最终结果,显示处理完成消息
|
// 如果没有收到最终结果,显示处理完成消息
|
||||||
window.message.success({ content: i18n.t('settings.asr.completed'), key: 'asr-processing' })
|
window.message.success({ content: i18n.t('settings.asr.completed'), key: 'asr-processing' })
|
||||||
|
|
||||||
// 如果有回调函数,调用一次空字符串,触发按钮状态重置
|
// 如果有回调函数,调用一次空字符串,触发按钮状态重置
|
||||||
if (this.resultCallback && typeof this.resultCallback === 'function') {
|
if (this.resultCallback && typeof this.resultCallback === 'function') {
|
||||||
// 使用空字符串调用回调,不会影响输入框,但可以触发按钮状态重置
|
// 使用空字符串调用回调,不会影响输入框,但可以触发按钮状态重置
|
||||||
this.resultCallback('')
|
this.resultCallback('')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (data.type === 'result' && data.data) {
|
} else if (data.type === 'result' && data.data) {
|
||||||
// 处理识别结果
|
// 处理识别结果
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user