fix(fa): clamp cut_end to prevent overlap with next sentence's FA start

When energy extends cut_end past the next sentence's FA start point,
clamp to midpoint between current FA end and next FA start. Fixes
issue where A[1] tail extension was eating into A[2]'s first char.
This commit is contained in:
Hawk Lee
2026-02-16 00:19:39 +08:00
parent c354adbca8
commit f0b741a6ab
+7
View File
@@ -799,6 +799,13 @@ class AIIA_Podcast_Stitcher:
cut_end = self._refine_cut_point(wav, sr, fa_end,
search_radius=0.15, direction="after")
# 防止尾部扩展吃进下一句的 FA 起点
if fa_results and sent_local_idx + 1 < len(fa_results):
next_fa = fa_results[sent_local_idx + 1]
if next_fa and cut_end > next_fa['start']:
# 取中点,而非硬切
cut_end = (fa_end + next_fa['start']) / 2
# 交叉验证:同时计算 VAD 和 Energy 的结果做对比
if use_vad and vad_timestamps_A is not None:
vad_ts = vad_timestamps_A if speaker == "A" else vad_timestamps_B