From f04ddde4d580cec32bb6f3cb7171c269f7cb77ca Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 9 Sep 2026 10:55:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20AI=E6=95=B0=E5=AD=97=E4=BA=BA=E5=85=8B?= =?UTF-8?q?=E9=9A=86=E9=9F=B3=E8=89=B2=E8=AF=95=E5=90=AC=E4=BC=A0=20profil?= =?UTF-8?q?e=20UUID=20=E8=80=8C=E9=9D=9E=20voice=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:后端 /tts/preview 用传入的 voice_id 去查 VoiceCloneProfile, 期望前端传 profile UUID(voice_clone_profile_id 或 clone.id)。 此前 clone 分支传了 voice_id(CosyVoice 模型 ID), 后端查不到 profile 静默返回,用户点播放无反应。 修复:clone 分支 targetId 改用 voice.voice_clone_profile_id || voice.id。 --- .../web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx b/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx index 467ab40dd..ce7dffdfd 100644 --- a/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx +++ b/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx @@ -128,12 +128,12 @@ export function PanelVoiceSelector({ /* 克隆音色:preview_url/audio_url 通常为空,需走 POST /tts/preview * 现合成示例文案再播放,对齐配音库 useAudioPlayer 行为 */ if (voice.type === "clone") { - const cached = previewCacheRef.current.get(voice.voice_id || voice.id) + const cached = previewCacheRef.current.get(voice.voice_clone_profile_id || voice.id) if (cached) { playAudioUrl(voice.id, cached) return } - const targetId = voice.voice_id || voice.id + const targetId = voice.voice_clone_profile_id || voice.id setPreviewingId(voice.id) try { const res = await previewTts({