braidio.script#
Composition model — the ordered beats a render walks.
A Script is an ordered list of beats: a Narration (spoken,
synthesized), a Dialogue (a multi-voice exchange), a SegmentBeat
(a reference to a span of source media to resolve and weave in), or a
SceneBreak (a structural boundary — “new section” — that the renderer
marks with music, see braidio.structure). This is the generic,
media-agnostic projection a renderer consumes; how a reference maps to audio is a
braidio.sources.SegmentSource concern, and what the beats are backed by
(lyrics, a graph, hand-authoring) is the consumer’s concern.
Functions
|
All narration (default text) of a script, as sentence-level segments. |
Classes
|
A multi-speaker commentary exchange (the conversational register). |
|
A spoken narration beat (authored, synthesized by TTS). |
|
A structural boundary between sections — the "new scene" beat. |
|
An ordered production script. |
|
A span of source media to weave in, addressed by an opaque |
- class braidio.script.Dialogue(turns, label='')[source]#
Bases:
objectA multi-speaker commentary exchange (the conversational register).
turnsis an ordered tuple of(role, text)pairs (roles like"A"/"B"map to voices via aConversationCastat render time). Rendered in ONE pass via Text-to-Dialogue so it sounds like people talking to each other. This is our own commentary → always publishable (its text is still scanned for forbidden verbatim quotes in the published cut).
- class braidio.script.Narration(text, style=None, published_text=None, lead_gap_s=0.0, voice=None, voice_settings=None)[source]#
Bases:
objectA spoken narration beat (authored, synthesized by TTS).
published_textis an optional rights-safe rewrite the published profile uses when the defaulttextquotes forbidden (e.g. copyrighted) content; leave itNonewhen the narration is already clean.lead_gap_sprepends a beat of silence — breathing room before a register change (e.g. a book-read entering after a conversation), so it doesn’t feel glued to the previous speaker.voiceandvoice_settingsare per-beat overrides so one timeline can carry contrasting roles — e.g. a lively presenter and a graver *book narrator* (different voice, and/or a different delivery preset’svoice_settings). Both fall back to the render’s production-level defaults whenNone.
- class braidio.script.SceneBreak(label='', marker=None)[source]#
Bases:
objectA structural boundary between sections — the “new scene” beat.
Audio has no visual white space, so a boundary has to be heard: the renderer marks it with a sting (a short musical marker) when the production supplies one and the resolved
markeris"sting", and otherwise with a beat of silence. This is the beat the format templates’ structure — a debate’s open / rebuttal / close, a panel’s rounds, a documentary’s acts — is expressed with; the talk on either side is unchanged.markeroverrides the format default per break (None= defer tobraidio.structure.MusicStructure.scene_marker).labelnames the section that starts here (e.g."rebuttal") for the timeline breakdown. A scene break synthesizes nothing, so it costs nothing.
- class braidio.script.Script(title, id_slug, beats=<factory>)[source]#
Bases:
objectAn ordered production script.
- class braidio.script.SegmentBeat(reference, label='', rights='owned-local', published_substitute=None, placement='before', spotlight=None)[source]#
Bases:
objectA span of source media to weave in, addressed by an opaque
reference.The renderer resolves
reference→[start,end)via aSegmentSourceand cuts it.rights(e.g.owned-local/copyrighted/public-domain) drives the render profile;published_substituteis a transformative narration the published profile swaps in when the segment’s audio can’t be used.placementis how the clip sits against the talk (the weaving grammar):"before"(default) and"after"play the clip clean in its own slot — the set-up→clip and clip→payoff patterns, distinguished by where you order the beat relative to the talk."under"plays the clip concurrently beneath the following talk beat, ducked byduck_db— the “host talks over the clip” technique (place the clip immediately before the talk it should sit under).spotlightis the fade-to-spotlight override:Truedrops the music bed out before this clip so it lands in silence rather than competing with underscore (the bed resumes after it);Falsekeeps the bed under it.None(default) defers to the format’sbraidio.structure.MusicStructure.spotlight_clips. Without a music bed the flag is inert.