Use this skill whenever the user wants to create, author, or generate timed speech scripts, audio dubbing scripts, narration tracks, or any kind of synchronized audio content using the ReDub library. Triggers include: "generate a dubbing script", "create timed narration", "write a TTML/DAPT script", "author a speech document with timing", "ReDub", "timed audio", "dubbing with agents", or any request to produce synchronized spoken audio with timing metadata. Also use when the user wants to understand how to structure audio timing, assign lines to voice actors/agents, add pronunciation hints, or convert frame-based timecodes to TTML seconds.
Use this skill whenever the user wants to create, author, or generate timed speech scripts, audio dubbing scripts, narration tracks, or any kind of synchronized audio content using the ReDub library. Triggers include: "generate a dubbing script", "create timed narration", "write a TTML/DAPT script", "author a speech document with timing", "ReDub", "timed audio", "dubbing with agents", or any request to produce synchronized spoken audio with timing metadata. Also use when the user wants to understand how to structure audio timing, assign lines to voice actors/agents, add pronunciation hints, or convert frame-based timecodes to TTML seconds.
ReDub Docs
ReDub is a React-based authoring system for timed speech and narration. It uses JSX to describe
a synchronized audio document, compiles the tree into a normalized AST, and serializes it to
TTML2 / DAPT XML — the interchange format used by professional dubbing pipelines.
Quick orientation
The public API is three exports:
Export
Purpose
compile(jsx)
Converts a JSX tree rooted at <Redub> into a DocumentNode AST
serialize(doc)
Converts a DocumentNode into TTML2 / DAPT XML string
When fps is given with from/to, ReDub converts frames to "Ns" TTML strings automatically.
Step 5 — Compile and serialize
const doc = compile(
<RedubxmlLang="en"langSrc="fr"scriptType="preRecording"scriptRepresents={["audio.dialogue"]}>
{/* head + body */}
</Redub>
);
const xml = serialize(doc);
// xml is a complete TTML2 / DAPT XML string ready for a dubbing pipeline
Common patterns
Minimal single-voice script
const xml = serialize(compile(
<RedubxmlLang="en"><divbegin="0s"end="5s"><p><spanbegin="0s">Welcome to the show.</span></p></div></Redub>
));
Useful when authoring metadata separately from the head:
const xml = serialize(compile(
<RedubxmlLang="en"><Redub.Metadataslot="metadata"><Agentid="narrator"type="character"alias="NARRATOR" /></Redub.Metadata><divbegin="0s"end="10s"><p><spanbegin="0s">And so it begins...</span></p></div></Redub>
));
What serialize() emits
The serializer automatically includes only the namespaces that are actually needed:
Condition
Namespace added
Always
tt (TTML)
Agent metadata present
ttm
DAPT attributes present (represents, agent)
dapt
Pronunciation extensions present
redub
Reference documentation
For the full API reference, timing details, failure behavior, and more examples, read: