Spaces:
Running
Running
v18.1 FINAL SYNC + POLISH — (1) subtitles now MATCH the voice: faster-whisper true timestamps + silence-aligned fallback (real pause detection replaces flat WPM drift); (2) QC SYNC GATE: every subtitle event validated against silencedetect of the voice — mid-pause subs block the render (edge-grace 0.25s); (3) robust black-frame check (needs 2+ true black frames); (4) outro fade-to-black; (5) QC issues now logged on failure
Browse files
main.py
CHANGED
|
@@ -106,11 +106,11 @@ def render_one(kind: str, topic: Optional[str] = None, force_topic: bool = False
|
|
| 106 |
result["tts_engine"] = tts_engine
|
| 107 |
live_status("stage", "whisper")
|
| 108 |
|
| 109 |
-
# 4) whisper timecodes (audio = source of truth)
|
|
|
|
| 110 |
from nexus.whisper_timecode import transcribe
|
| 111 |
-
# sidecar script text must exist BEFORE transcribe (WPM fallback reads it)
|
| 112 |
(voice_path.with_suffix(".txt")).write_text(script["text"], encoding="utf-8")
|
| 113 |
-
tcs = transcribe(voice_path, kind)
|
| 114 |
words = tcs["words"]
|
| 115 |
if not words and script["text"]:
|
| 116 |
from nexus.whisper_timecode import _estimate_words
|
|
@@ -181,6 +181,7 @@ def render_one(kind: str, topic: Optional[str] = None, force_topic: bool = False
|
|
| 181 |
qc = quality_control(out, voice_path, thumb_meta, kind, ass_path)
|
| 182 |
result["qc"] = {"score": qc["score"], "pass": qc["pass"], "issues": qc["issues"]}
|
| 183 |
if not qc["pass"]:
|
|
|
|
| 184 |
quarantine(out)
|
| 185 |
result["error"] = "QC failed: %s" % "; ".join(qc["issues"][:3])
|
| 186 |
live_status("stage", "failed", result)
|
|
|
|
| 106 |
result["tts_engine"] = tts_engine
|
| 107 |
live_status("stage", "whisper")
|
| 108 |
|
| 109 |
+
# 4) whisper timecodes (audio = source of truth) — text passed for
|
| 110 |
+
# silence-aligned fallback so subs ALWAYS match the voice
|
| 111 |
from nexus.whisper_timecode import transcribe
|
|
|
|
| 112 |
(voice_path.with_suffix(".txt")).write_text(script["text"], encoding="utf-8")
|
| 113 |
+
tcs = transcribe(voice_path, kind, script_text=script["text"])
|
| 114 |
words = tcs["words"]
|
| 115 |
if not words and script["text"]:
|
| 116 |
from nexus.whisper_timecode import _estimate_words
|
|
|
|
| 181 |
qc = quality_control(out, voice_path, thumb_meta, kind, ass_path)
|
| 182 |
result["qc"] = {"score": qc["score"], "pass": qc["pass"], "issues": qc["issues"]}
|
| 183 |
if not qc["pass"]:
|
| 184 |
+
log.error("QC FAIL: %s", "; ".join(qc["issues"]))
|
| 185 |
quarantine(out)
|
| 186 |
result["error"] = "QC failed: %s" % "; ".join(qc["issues"][:3])
|
| 187 |
live_status("stage", "failed", result)
|