Expand description
Voice clips: a manifest that lists every clip by dialogue line id, and a cast that says which voice says each speaker’s lines. A game ships its clips beside it, so nothing here reads a file: the game reads the text and these functions parse and validate it.
A clip records the words it says (spoken). When the line says
something else today (a name in the names table changed), the clip is
stale and is left out of the Playable set. A line whose words
change with something the player picks (a hero’s pronouns, say) has one
clip per ClipVariant the game names.
The cast is written for the tool that makes the voices: each entry
names the voice (what a clip’s voice records: a reference clip’s name
for a generated voice, an actor’s for a recorded one) and the settings
only that tool knows, of the tool’s own type S (() for none, written
settings: ()). A key is a speaker, or a speaker followed by a
variant’s suffix for that variant’s clips:
(voices: {
">": (voice: "narrator", settings: (reader: Kokoro)),
"hero": (voice: "hero_deep", settings: (reader: Kokoro)),
"hero.light": (voice: "hero_light", settings: (reader: Piper)),
})A voice tool plans its work with plan: which clips to make, record
again or remove, and each voice’s recording script.
Modules§
- plan
- What a voice tool has to do for one language, as a pure function of the
dialogue, the scenes to voice, the cast and the manifest’s clips: the
clips to make or make again (and why), the recorded clips a person must
record again, the clips to remove and the lines nobody is cast to say.
The tool reads and writes its files;
planonly says what to do.
Structs§
- Cast
- Which voice says each speaker’s lines, with the settings of the tool
that makes them (
S). - Cast
Voice - One voice of the
Cast. - Playable
- The clips that may be played: those that say what their line says today.
- Voice
Clip - One clip of the manifest.
- Voice
Manifest - The validated voice manifest of one language.
Enums§
- MadeBy
- Who or what made a clip (the credits say which voices are generated).
Traits§
- Clip
Variant - Which recording of a line a clip is: the game’s type, with its default for a line’s only clip.
Functions§
- cast_
from_ source - Parses and validates cast
source, attributing errors tofileat each entry’s line: no voice is empty, every key is a speaker that isNARRATION_SPEAKERor one thatcan_speak, or such a speaker followed by thesuffixof one ofV’svariants. A key that is a speaker is the speaker’s, whatever it ends with. SettingsSrejects are a parse error. - clip_
file - A clip’s file, relative to its language’s folder:
<scene id>/<line id>.ogg, with the variant’ssuffixbefore.ogg. - from_
source - Parses and validates manifest
source, attributing errors tofile: every clip’s line exists indialogue, no line has the same variant twice, a line has either its only clip or everysplitone, andspokenandvoicearen’t empty. Reports every problem found. - line_
texts - The text of every dialogue line, by line id.