feat(ai-avatar): 前端对接 #1826 后端契约 — 模式A对口型/语速情绪/智能封面/标题字段映射 #1828
Reference in New Issue
Block a user
Delete Branch "feat/ai-avatar-frontend-contract-1822"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
对接后端 PR #1826(已合入 fix/ai-avatar-v3-1797)的接口契约。仅前端改动,后端保持 #1826 不变。
改动内容
video_url(素材 id 先经/assets/{id}换file_url,禁传video_asset_id)+voice_id+script_text+speed+emotion(英文枚举)。不先调 TTS 拿 audio_url。previewTts均透传speed;情绪中文 自然/兴奋/沉稳/亲切 →natural/excited/calm/friendly(normalizeEmotion防御性映射)。POST /ai-avatar/render/smart-cover,基于对口型成片output_video_urlMediaKit 抽帧评分,返回cover_url写入封面预览;未完成对口型时按钮禁用并提示。title_config以packages/domain/video_filter_builder.py的build_title_drawtext_filter()为唯一口径 →text/font_size/font_color(#RRGGBB)/position(top/center/bottom/custom,口播默认 bottom)/enabled/bold/stroke/shadow/pos_x/pos_y;不传 文档误写的titles[]/fontSize/frame/start/end。新增utils/contract.ts转换层。验收链路
选视频 → 选音色(调语速/情绪) → 输文案 → 生成对口型(无422、轮询识别 running) → 标题在口播预览可见且位置正确 → 智能封面出图 → 提交渲染。
校验
npx tsc --noEmit:ai-avatar/contract 零错误(仅存 develop 本就有的 3 个测试类型包/baseUrl 环境噪声,非本次代码)。