diff --git a/apps/web/src/pages/voices/components/TtsModal.tsx b/apps/web/src/pages/voices/components/TtsModal.tsx index 29ff0202f..953792f43 100755 --- a/apps/web/src/pages/voices/components/TtsModal.tsx +++ b/apps/web/src/pages/voices/components/TtsModal.tsx @@ -1,4 +1,4 @@ -import React from "react" +import React, { useMemo } from "react" import { Modal } from "antd" import { type TtsModalProps, type TtsStatus } from "./tts-modal/types" import TextInputSection from "./tts-modal/TextInputSection" @@ -9,6 +9,7 @@ import LanguageControl from "./tts-modal/LanguageControl" import SynthesizeButton from "./tts-modal/SynthesizeButton" import ErrorAlert from "./tts-modal/ErrorAlert" import ResultPanel from "./tts-modal/ResultPanel" +import { PRESET_TTS_LANGUAGE_OPTIONS, CLONE_TTS_LANGUAGE_OPTIONS } from "./tts-modal/constants" /** AI 配音弹窗 */ const TtsModal: React.FC = ({ @@ -32,6 +33,13 @@ const TtsModal: React.FC = ({ onSynthesize, onSave, }) => { + // 预置音色(含空默认)仅支持 zh/en;克隆音色支持全语言列表 + const isCloneVoice = useMemo( + () => !!ttsVoiceId && clonedVoices.some((v) => v.id === ttsVoiceId), + [ttsVoiceId, clonedVoices], + ) + const languageOptions = isCloneVoice ? CLONE_TTS_LANGUAGE_OPTIONS : PRESET_TTS_LANGUAGE_OPTIONS + return (
= ({ }} > - +