From 32d78d0f8d6085d0870af1c6de43760b6496567c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique?= Date: Wed, 26 Aug 2026 17:15:44 -0400 Subject: [PATCH] =?UTF-8?q?fix(qc):=20padding=20padr=C3=A3o=20do=20remove?= =?UTF-8?q?=5Fmedia=5Fsilence=20de=200,05s=20para=200,2s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0,05s existia como margem de segurança contra cortar a palavra em cima, mas um silêncio que essa ferramenta encontra costuma ser o respiro natural antes de uma frase nova, não sujeira de edição — e 0,05s raspava esse respiro quase todo. Caso real (projeto Mastopexia): a pausa antes de "Com" tinha 0,567s no áudio original; com padding 0,05 sobrou só ~0,1s no total (0,05 de cada lado), colando o clipe seguinte a 5ms da palavra em vez de deixar uma pausa perceptível. 0,2s alinha com a convenção já documentada para folga em corte de fronteira de frase (editar-por-voz/06-texto-corte-marcador.md). Co-Authored-By: Claude Sonnet 5 --- code/fcpxml/model_manager.py | 9 ++++++++- code/server_tools/qc.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/code/fcpxml/model_manager.py b/code/fcpxml/model_manager.py index 18e211d..77c86f6 100644 --- a/code/fcpxml/model_manager.py +++ b/code/fcpxml/model_manager.py @@ -644,7 +644,14 @@ DEFAULT_SILENCE_CONFIG: dict = { # Seconds a quiet stretch must last before it's a cut candidate. "min_silence": 0.5, # Seconds left inside each cut so speech never gets clipped at the edges. - "padding": 0.05, + # 0.2s matches the breathing-room convention for phrase-boundary cuts + # (see editar-por-voz/criterios/06-texto-corte-marcador.md) — a silence + # span this tool finds is often the natural breath before a new + # sentence, not just editing slop, and 0.05s shaved that breath down to + # almost nothing (real case: Mastopexia project, the pause before "Com" + # went from 0.567s to 0.1s across the cut, landing the next clip only + # 5ms after the word instead of a natural pause before it). + "padding": 0.2, } diff --git a/code/server_tools/qc.py b/code/server_tools/qc.py index 47b4e69..a4e5679 100644 --- a/code/server_tools/qc.py +++ b/code/server_tools/qc.py @@ -155,7 +155,7 @@ TOOLS = [ "filepath": {"type": "string", "description": "Path to FCPXML file"}, "noise_db": {"type": "number", "description": "Silence threshold in dBFS, -120 to 0. Falls back to the saved silence settings (default -30)"}, "min_silence": {"type": "number", "description": "Minimum silence duration in seconds to cut. Falls back to the saved silence settings (default 0.5)"}, - "padding": {"type": "number", "description": "Seconds of silence to keep on each side of a cut so edits breathe (max 5). Falls back to the saved silence settings (default 0.05)"}, + "padding": {"type": "number", "description": "Seconds of silence to keep on each side of a cut so edits breathe (max 5). Falls back to the saved silence settings (default 0.2)"}, "clip_name": {"type": "string", "description": "Only cut silence in the clip with this name"}, "output_path": {"type": "string", "description": "Output path (default: adds _silence_removed suffix)"}, },