Explicit Dubbing & Time Window
Default Policy & Trigger
Normal formal post-production retains the original audio of the source video; no automatic dialogue generation occurs if no audio track exists. Only when a user or a confirmed production request explicitly chooses dubbing, TTS, or voice replacement is voicewrite.speak / dub invoked. Successfully rendered shots will not be rejected due to "not reading all lines", incorrect lip sync, poor voice quality, or loudness values.
Real authorization for cloned voices, scope of use, and current voiceprint profile are retained. The independent voicewrite.verify is the explicit diagnostic entry point and is not called during default acceptance of composite, mix, or master output.
I. Input & Parameter Table
| Item | Actual Use | Boundary |
|---|---|---|
| video / out | Original video and new dubbed version | Real files, allowed paths, prohibits overwriting source |
| profile | Authorized voice profile | Must not assume successful registration equals all external authorization |
| text / text_file | A segment of requested text | No silent script editing, abbreviation, or replacement via ASR |
| segments | Segment start time, text, and time window | Non-negative start times only, valid time windows, preserve declared order |
| policy | Original audio retention and explicit mixing strategy | Discarding original audio requires allow_discard_original authorization |
| lufs / duck_db / original_gain_db | Requested processing parameters | Not quality approval scores for original audio |
| allow_overflow | Explicit compatibility item for exceeding windows | Must not be used to conceal true window overruns or alter undeclared text |
II. Process Decisions
- User requests to keep original audio: original program is retained, may explicitly add narration or music; no automatic separation, re-recording, or noise reduction.
- User requests dubbing: execute one-shot engine synthesis based on the given text, voice profile, and segment time windows, then one-shot mixing; video codec uses stream copy.
- Dubbing sentence does not fit into the explicit time window: report as a request processing error, do not automatically speed up dialogue, edit script, or loop speech rates to fake completion.
- When the old video's original audio track contains both dialogue and ambient sound, it is a complete program; cannot claim to have obtained independent dialogue / ambient stems.
- When no audio track exists, explicit dubbing may generate new requested audio; normal source video delivery retains the fact of no track, no automatic TTS.
III. Executable Entry Points
node bundles/ai-video/connectors/voice-bridge/cli.mjs voices
node bundles/ai-video/connectors/voice-bridge/cli.mjs speak --profile authorized-voice --file script.txt --out narration.wav
node bundles/ai-video/connectors/voice-bridge/cli.mjs dub --in master.mp4 --out dubbed.mp4 --profile authorized-voice --segments segments.json --policy keep-dialogue
This skill showcases the interface; explicit dubbing authorization for this task is still required before execution; do not interpret "default post-production includes voice stage" as a new TTS request.
IV. SOP & Evidence Checkpoints
- Trigger: Receive an explicit dubbing request. Read authorized voice profile, source video, and per-segment text. Acknowledgment: profile, authorization scope, source video hash, and segment list. Failure: authorization, file, time window, or scope error stops processing.
- Trigger: Synthesis conditions met. Invoke the authorized engine once, then mix according to original audio policy. Acknowledgment: actual engine, invocation parameters, segment audio, and mix command. Failure: engine, decoding, mix, or time window errors propagate; no script editing or second voice generation.
- Trigger: Output completed. Verify file, audio track, video copy, and source preservation. Acknowledgment: output SHA-256, byte count,
qualityReviewed=false, untestedasr/lufs/peakfields. Failure: missing artifacts or changed video codec packet stops delivery, retains real failure logs.
V. Parameter Boundaries
- Must retain original source and historical files; input and output paths must differ.
- Requires explicit voice usage license; no automatic application for broader scope or substitution of unauthorized voices.
- Prohibits triggering re-TTS based on voice activity, dialogue similarity, lip sync, LUFS, or peak quality thresholds.
- Prohibits declaring dubbing complete after covering actual processing failures with silence or old audio tracks.
VI. Failure Modes (Cause → Remediation)
| Symptom | Cause / Detector | Remediation |
|---|---|---|
| Engine unavailable | Actual process, network, or model loading error | Retain error and generated segments, stop, do not switch to unauthorized engine |
| Insufficient voice authorization | Consent scope, validity, or profile mismatch | Stop that invocation, point to actual missing authorization |
| Sentence exceeds window | Conflict between requested time window and actual segment processing | Report specific segment and time, do not automatically alter dialogue or re-synthesize |
| Video re-encoded | Video packet SHA mismatch | Stop delivery, locate mix parameters, preserve source |
| Original audio unexpectedly lost | Policy / allow_discard_original does not match actual mapping | Report real error, do not treat original audio loss as default success |
| User requests voice change | Explicit new request | New authorization, new version, only process audio layer, reuse shots |
Output Contract
Each explicit dubbing request delivers a new audio or video file along with its current SHA-256, actual duration, sample rate, and channel count; records the adopted voice profile, authorization scope, original script, per-segment time windows, actual engine, and mix parameters. Original video codec packets and source are preserved; discarding original audio is recorded only upon explicit authorization. Tool, source, or time window failures must retain the error, and must not deliver old files masquerading as the current output.
The acknowledgment indicates whether the requested loudness processing was performed; qualityReviewed=false, untested ASR, lip sync, LUFS, or voice quality remains null/unverified. Versions only increment, no overwriting; subsequent user voice changes or single sentence edits form a new explicit request, and do not trigger frame regeneration.