From fafaebb051907a848a9406f9da19669c81a83a3b Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 26 Sep 2026 20:50:41 -0300 Subject: Translate code, comments and logs to English; English README; configurable paths and env vars Identifiers, docstrings, comments and console messages are now in English. Narration, subtitles and on-screen text stay in Spanish (they are the video content). The Blender <-> Godot physics protocol uses English keys and body prefixes chosen to keep the original creation order, so cached simulations and renders stay bit-identical. The old Spanish environment variable names are still accepted. --- scripts/verify_final.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'scripts/verify_final.py') diff --git a/scripts/verify_final.py b/scripts/verify_final.py index 7be410b..1ed848e 100644 --- a/scripts/verify_final.py +++ b/scripts/verify_final.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -"""QA sobre el MP4 terminado: extrae el audio ya mezclado con la musica, -lo corta segun el timeline y lo transcribe. Prueba que se entiende la voz -por encima de la cama, no solo que el WAV suelto estaba bien.""" +"""QA on the finished MP4: extracts the audio already mixed with the music, +cuts it by the timeline and transcribes it. It proves the voice is +intelligible over the bed, not just that the loose WAV was fine.""" import json, os, subprocess, sys from difflib import SequenceMatcher @@ -11,39 +11,39 @@ from narration import SCRIPTS from verify import norm from gen_audio import transcribe -LIMITE = 0.88 +LIMIT = 0.88 def main(names): - peor = [] + worst = [] for name in names: mp4 = os.path.join(ROOT, "out", f"{name}.mp4") tl = json.load(open(os.path.join(ROOT, "out", f"{name}_timeline.json"))) segs = json.load(open(os.path.join(ROOT, "audio", name, "segments.json")))["segments"] work = os.path.join(ROOT, "tmp", name + "_fin") os.makedirs(work, exist_ok=True) - entero = os.path.join(work, "todo.wav") + integer = os.path.join(work, "todo.wav") subprocess.run(["ffmpeg", "-v", "error", "-y", "-i", mp4, "-vn", - "-ac", "1", "-ar", "16000", entero], check=True) + "-ac", "1", "-ar", "16000", integer], check=True) - trozos = [] + chunks = [] for bt in tl["beats"]: p = os.path.join(work, f"{bt['i']:02d}.wav") subprocess.run(["ffmpeg", "-v", "error", "-y", "-ss", f"{bt['start']:.3f}", - "-t", f"{segs[bt['i']]['dur'] + 0.25:.3f}", "-i", entero, + "-t", f"{segs[bt['i']]['dur'] + 0.25:.3f}", "-i", integer, "-c", "copy", p], check=True) - trozos.append(p) - tr = transcribe(trozos, work) + chunks.append(p) + tr = transcribe(chunks, work) print(f"\n=== {name} (mezcla final) ===") - for bt, p in zip(tl["beats"], trozos): + for bt, p in zip(tl["beats"], chunks): i = bt["i"] got = tr[p] r = SequenceMatcher(None, norm(segs[i]["tts"]), norm(got)).ratio() - if r < LIMITE: - peor.append((name, i, r)) - print(f" {i:02d} {'OK ' if r >= LIMITE else 'REV'} {r:.2f} | {got}") - print("\n>> a revisar:", peor if peor else "nada") + if r < LIMIT: + worst.append((name, i, r)) + print(f" {i:02d} {'OK ' if r >= LIMIT else 'REV'} {r:.2f} | {got}") + print("\n>> a revisar:", worst if worst else "nada") if __name__ == "__main__": -- cgit v1.2.3