mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-17 14:33:41 +08:00
feat: 语音选择
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -55,10 +55,10 @@ export function STTConfigList(props: {
|
||||
{props.sttConfig.engine === "Web Speech API" && !isFirefox() && (
|
||||
<ListItem title="语言选择">
|
||||
<Select
|
||||
value={props.sttConfig.language}
|
||||
value={props.sttConfig.lang}
|
||||
onChange={(e) => {
|
||||
props.updateConfig(
|
||||
(config) => (config.language = e.currentTarget.value),
|
||||
(config) => (config.lang = e.currentTarget.value),
|
||||
);
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user