fix(frontend): #1898 配音库AI配音增加情绪语言选择
- TTS 弹窗新增情绪下拉(自然/兴奋/沉稳/亲切,默认自然)和语言下拉(中文/英文/日文/韩文,默认中文) - 新增 EmotionControl、LanguageControl 组件,与 SpeedControl 风格一致(tts-modal 目录下) - useTtsSynthesize hook 管理 emotion/language 状态,关闭弹窗时重置 - synthesizeSpeech 请求真实传递 emotion 和 language 参数到后端 - VoiceModals/VoiceLibrary 全链路透传新增 props - api/tts/types 的 TTSSynthesizeRequest 和 TTSPreviewRequest 补充 emotion/language 类型
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
/** TTS 情绪选项(对齐后端 CosyVoice 支持:natural/excited/calm/friendly) */
|
||||
export const TTS_EMOTION_OPTIONS = [
|
||||
{ value: "natural", label: "自然" },
|
||||
{ value: "excited", label: "兴奋" },
|
||||
{ value: "calm", label: "沉稳" },
|
||||
{ value: "friendly", label: "亲切" },
|
||||
] as const
|
||||
|
||||
export type TtsEmotion = (typeof TTS_EMOTION_OPTIONS)[number]["value"]
|
||||
|
||||
/** TTS 语言选项 */
|
||||
export const TTS_LANGUAGE_OPTIONS = [
|
||||
{ value: "zh-CN", label: "中文" },
|
||||
{ value: "en", label: "英文" },
|
||||
{ value: "ja", label: "日文" },
|
||||
{ value: "ko", label: "韩文" },
|
||||
] as const
|
||||
|
||||
export type TtsLanguage = (typeof TTS_LANGUAGE_OPTIONS)[number]["value"]
|
||||
|
||||
export const DEFAULT_TTS_EMOTION: TtsEmotion = "natural"
|
||||
export const DEFAULT_TTS_LANGUAGE: TtsLanguage = "zh-CN"
|
||||
Reference in New Issue
Block a user