From b2da958dc64cd2ce5a8a3a9dff0c415839375e4d Mon Sep 17 00:00:00 2001 From: Hawk Lee Date: Mon, 26 Jan 2026 11:33:17 +0800 Subject: [PATCH] fix(Ditto): clear StitchNetwork buffer on speech onset to prevent smoothing glitches --- libs/Ditto/stream_pipeline_offline.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/Ditto/stream_pipeline_offline.py b/libs/Ditto/stream_pipeline_offline.py index 85accfe..ff9d39f 100644 --- a/libs/Ditto/stream_pipeline_offline.py +++ b/libs/Ditto/stream_pipeline_offline.py @@ -460,8 +460,16 @@ class StreamSDK: else: # onset_idx == 0. We are at Onset. if silence_frames_count >= min_silence_for_reset: - do_reset = True + do_reset = True print(f"[Ditto] Speech Onset at Frame {idx}. RESET triggered (Silence: {silence_frames_count}).") + + # [v1.9.400] STITCHER RESET (Fix Onset Jump) + # We must clear the Stitcher's expression buffer so it doesn't + # smooth the new speech with the old silence (closed mouth). + if hasattr(motion_stitcher, 'exp_buffer'): + motion_stitcher.exp_buffer = [] + motion_stitcher.last_speaking_exp = None + print(f" > Stitcher Buffer Cleared.") silence_frames_count = 0 # Handle trailing