diff --git a/apps/web/src/api/tts/types.ts b/apps/web/src/api/tts/types.ts index 39e1046d5..e7d5c7850 100644 --- a/apps/web/src/api/tts/types.ts +++ b/apps/web/src/api/tts/types.ts @@ -103,6 +103,7 @@ export interface TTSPreviewRequest { voice_id: string speed?: number pitch?: number + emotion?: string // 情绪参数:natural/excited/calm/friendly } /** TTS 试听响应 */ diff --git a/apps/web/src/pages/ai-avatar/AiAvatarPage.tsx b/apps/web/src/pages/ai-avatar/AiAvatarPage.tsx index 24fd408d7..55bc2110c 100644 --- a/apps/web/src/pages/ai-avatar/AiAvatarPage.tsx +++ b/apps/web/src/pages/ai-avatar/AiAvatarPage.tsx @@ -93,6 +93,7 @@ const AiAvatarPage: React.FC = () => { voice_id: voice.voice_id, script_text: state.scriptText, video_url: videoUrl, + emotion: state.emotion, // 传递情绪参数 } console.log("[对口型] createLipsyncJob 请求:", payload) const job = await createLipsyncJob(payload) diff --git a/apps/web/src/pages/ai-avatar/api/aiAvatar.ts b/apps/web/src/pages/ai-avatar/api/aiAvatar.ts index 75704c47c..d8c53523b 100644 --- a/apps/web/src/pages/ai-avatar/api/aiAvatar.ts +++ b/apps/web/src/pages/ai-avatar/api/aiAvatar.ts @@ -39,6 +39,7 @@ export const createLipsyncJob = async (data: { voice_id: string script_text: string video_url: string + emotion?: string // 情绪参数:natural/excited/calm/friendly }): Promise => { const response = await apiClient.post("/lipsync/jobs", data) return response.data diff --git a/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx b/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx index 6af6e2a0e..a67f15aff 100644 --- a/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx +++ b/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx @@ -151,6 +151,7 @@ export function PanelVoiceSelector({ text: VOICE_PREVIEW_TEXT, voice_id: targetId, speed: 1.0, + emotion: emotion, // 传递情绪参数 }) console.log("[AI数字人-克隆试听] previewTts 响应:", { audio_url: res.audio_url?.substring(0, 80),