diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2026-09-26 20:50:41 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2026-09-26 20:50:41 -0300 |
| commit | fafaebb051907a848a9406f9da19669c81a83a3b (patch) | |
| tree | c30ea26e6b549e5523af2bae5c39569e9a946b12 /scripts/verify_final.py | |
| parent | 59355909f2de9236af8168a26c70bcf6caa3b285 (diff) | |
| download | 100cia-videos-fafaebb051907a848a9406f9da19669c81a83a3b.tar.gz 100cia-videos-fafaebb051907a848a9406f9da19669c81a83a3b.zip | |
Translate code, comments and logs to English; English README; configurable paths and env varsHEADmain
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.
Diffstat (limited to 'scripts/verify_final.py')
| -rw-r--r-- | scripts/verify_final.py | 32 |
1 files changed, 16 insertions, 16 deletions
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__": |