chore: wip

This commit is contained in:
DDMeaqua 2024-10-12 19:44:54 +08:00
parent 80a7a1d9d0
commit 43d38249d3

View File

@ -575,16 +575,18 @@ export function ChatActions(props: {
if (speechApi) { if (speechApi) {
await speechApi.start(); await speechApi.start();
setIsListening(true); setIsListening(true);
document.getElementById("chat-input")?.focus();
} }
}; };
const stopListening = async () => { const stopListening = async () => {
showToast(Locale.Chat.CloseSpeak);
if (speechApi) { if (speechApi) {
if (config.sttConfig.engine !== DEFAULT_STT_ENGINE) if (config.sttConfig.engine !== DEFAULT_STT_ENGINE)
setIsTranscription(true); setIsTranscription(true);
await speechApi.stop(); await speechApi.stop();
setIsListening(false); setIsListening(false);
} }
showToast(Locale.Chat.CloseSpeak); document.getElementById("chat-input")?.focus();
}; };
const onRecognitionEnd = (finalTranscript: string) => { const onRecognitionEnd = (finalTranscript: string) => {
console.log(finalTranscript); console.log(finalTranscript);