From b91c224d75af8b8551a254c2c485d533218430de Mon Sep 17 00:00:00 2001 From: DDMeaqua Date: Mon, 14 Oct 2024 11:28:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=AD=E9=9F=B3=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/chat.tsx | 6 ++++-- app/components/stt-config.tsx | 4 ++-- app/store/config.ts | 2 +- app/utils/speech.ts | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index a52f3b13b..3ce9c993e 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -558,10 +558,12 @@ export function ChatActions(props: { useEffect(() => { if (isFirefox()) config.sttConfig.engine = FIREFOX_DEFAULT_STT_ENGINE; + const lang = config.sttConfig.lang; setSpeechApi( config.sttConfig.engine !== DEFAULT_STT_ENGINE - ? new WebTranscriptionApi((transcription) => - onRecognitionEnd(transcription), + ? new WebTranscriptionApi( + (transcription) => onRecognitionEnd(transcription), + lang, ) : new OpenAITranscriptionApi((transcription) => onRecognitionEnd(transcription), diff --git a/app/components/stt-config.tsx b/app/components/stt-config.tsx index 478259041..01a63cd5f 100644 --- a/app/components/stt-config.tsx +++ b/app/components/stt-config.tsx @@ -55,10 +55,10 @@ export function STTConfigList(props: { {props.sttConfig.engine === "Web Speech API" && !isFirefox() && (