From f0b741a6abf3ba908ea242c49ef7b93ea9d83da2 Mon Sep 17 00:00:00 2001 From: Hawk Lee Date: Mon, 16 Feb 2026 00:19:39 +0800 Subject: [PATCH] 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. --- aiia_podcast_stitcher.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aiia_podcast_stitcher.py b/aiia_podcast_stitcher.py index 5b573d6..54abebf 100644 --- a/aiia_podcast_stitcher.py +++ b/aiia_podcast_stitcher.py @@ -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