VO delivery audit¶
The reconciliation pair to the loc-table manifest driver (issue #42):
audit_delivery compares a delivered audio folder against the loc-table the
way a localization vendor's pre-delivery QA pass does — missing lines, orphan
files, naming-convention violations, empty takes, and script↔audio duration
mismatches. It is deterministic set/arithmetic over file stats + the manifest (no
ML), and read-only over the delivered folder: it only walks it and reads WAV
headers/samples, never writing there. It shares the #40
read_manifest parser and reuses
pipeline.wav_duration for stats.
python -m openfacefx audit --manifest loc.csv --delivered vo/ \
--duration-tolerance 0.4 --cps 14 --json
The report (a superset of the batch_summary.json shape — format/version
self-describing, every list sorted, keyed by loc-ID) itemizes:
| kind | flagged when |
|---|---|
missing |
a manifest row's declared audio is absent from the delivery |
orphan |
a delivered .wav no manifest row references |
duration |
actual length outside ±--duration-tolerance of the len(text)/--cps estimate (a take inside tolerance is never flagged) |
empty |
a zero-duration or near-silent (~0 RMS) take |
naming |
a delivered file whose stem doesn't match the loc-ID convention |
unreadable |
a file wav_duration cannot parse |
plus a language-coverage matrix ({loc-ID: {locale: present}}) surfacing
per-locale holes. The audit command exits nonzero when any issue is found (a
CI QA gate) and prints a human worst-first table, or the full JSON report with
--json. Audio paths resolve relative to --delivered (the delivery root).
Deterministic; stdlib + numpy (RMS only).
openfacefx.vo_audit
¶
VO delivery QA at scale (issue #42): reconcile a delivered folder against the loc-table manifest.
Localization vendors run a pre-delivery QA pass that reconciles the delivered VO
against the script — missing lines, orphan files, naming-convention violations,
empty takes, and script<->audio duration mismatches. This is that pass as
deterministic set/arithmetic over file stats + the #40 manifest — no ML, and
read-only over the delivered folder (it only walks it and reads WAV headers;
it never writes there). It is the reconciliation pair to
:mod:openfacefx.batch_manifest: it shares that module's
:func:~openfacefx.batch_manifest.read_manifest parser and reuses
:func:openfacefx.pipeline.wav_duration for stats.
:func:audit_delivery returns a deterministic, itemized report — a superset of
the batch_summary.json shape (format/version self-describing, stable
key order, every list sorted) — keyed by loc-ID:
- missing — a manifest row whose declared audio is absent from the delivery;
- orphan — a delivered
.wavthat no manifest row references; - duration — actual length outside a configurable tolerance of the length
estimated from the transcript (
len(text) / cpsseconds); - empty — a zero-duration or near-silent (~0 RMS) take;
- naming — a delivered file whose stem does not match the loc-ID convention;
- unreadable — a file
wav_durationcannot parse.
plus a language-coverage matrix ({loc-ID: {locale: present}}) that surfaces
per-locale holes. Audio paths in the manifest are resolved relative to the
delivered folder (the delivery root). Deterministic and stdlib + numpy (RMS only).
AUDIT_FORMAT = 'openfacefx.vo_audit'
module-attribute
¶
AUDIT_VERSION = 1
module-attribute
¶
EMPTY_DURATION = 0.02
module-attribute
¶
SILENT_RMS = 0.0001
module-attribute
¶
DEFAULT_CPS = 14.0
module-attribute
¶
DEFAULT_TOLERANCE = 0.5
module-attribute
¶
audit_delivery(manifest_path: str, delivered_dir: str, *, duration_tolerance: float = DEFAULT_TOLERANCE, cps: float = DEFAULT_CPS) -> Dict
¶
Reconcile delivered_dir against the loc-table manifest_path.
Returns the deterministic audit report dict. duration_tolerance is the
fraction a take may differ from its len(text)/cps estimate before it is
flagged — a take inside [expected*(1-tol), expected*(1+tol)] is never a
duration issue. Nothing under delivered_dir is written.
Source code in src/openfacefx/vo_audit.py
audit_report_text(report: Dict) -> str
¶
A human, worst-first summary of an :func:audit_delivery report: the
itemized issues then the language-coverage matrix (present * / hole .).