优化替换角色添加音频

This commit is contained in:
Azmat@qq.com
2026-09-01 17:55:57 +08:00
parent a520b230c5
commit 0603a85d83
10 changed files with 322 additions and 111 deletions
+6 -6
View File
@@ -132,11 +132,11 @@ PERSONA_BRIEFS: dict[str, str] = {
}
_PERSONA_KEY_BY_LABEL = {label: key for key, label in PERSONA_LABELS.items()}
# 电商口播需要同时承载观点、证据和转折;15 秒以 4.3–5.2 字/秒为可用区间。
# 这比日常闲聊快,但仍给句间停顿和镜头切换留出空间。
NARRATION_CHARS_PER_SECOND = 5.2
NARRATION_CHARS_PER_SECOND_MIN = 4.3
NARRATION_CHARS_HARD_CAP = 78
# 电商口播需要同时承载观点、证据和转折;15 秒固定以 5.0–5.7 字/秒为目标区间。
# 用户希望旁白更完整,因此每镜目标为 75–85 字;仍以短句切分,给镜头切换留空间。
NARRATION_CHARS_PER_SECOND = 5.7
NARRATION_CHARS_PER_SECOND_MIN = 5.0
NARRATION_CHARS_HARD_CAP = 85
# 故事板下线后,visual 是出片模型唯一的画面依据,门槛从「够写一句」抬到「够当导演说明书」
VISUAL_CHARS_MIN = 110
SHOT_BEATS_MIN = 3
@@ -291,7 +291,7 @@ def recommend_script_setup(category: str = "", title: str = "") -> dict:
def narration_limit(duration: int) -> int:
"""这一镜旁白的字数上限:秒数 × 5.2,且不超过硬上限 78。"""
"""这一镜旁白的字数上限:秒数 × 5.7,且不超过硬上限 85。"""
return max(1, min(NARRATION_CHARS_HARD_CAP, int(duration * NARRATION_CHARS_PER_SECOND)))