voice
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
voice
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.audio.voice — turning the written script into spoken clips, once. `audio_gen`'s speech operation lands its result in `/zero/source/generated/ audio/` under a name derived from the words, which is neither stable nor ours. This module harvests each finished generation into `game/audio/voice/<key>.soundClip`, where `<key>` is the line's own key from `game.audio.lines`, so the runtime can resolve a bark by name and a hot reload never re-buys the script. The service rate-limits: firing all thirty-five lines at once returned `upstream 429` for two thirds of them. `generate()` therefore paces itself and is safe to call repeatedly — it only ever works on lines that are still missing a clip.
has(key: string) → boolean
--!desc Whether a line already has a cached clip. --!arg key A line key from game.audio.lines. --!return true when the `.soundClip` exists. --!example if Voice.has("anselm_attack_1") then ... end
| arg | type | description |
|---|---|---|
| key | string |
pending( ) → void
--!desc Every line still missing its spoken clip. --!return An array of { key, text, voice }. --!example local todo = Voice.pending()
generatedName(text: string) → string
The generated container's directory name, as the service derives it: the first forty characters of the text, with everything but letters, digits and spaces turned into underscores, then spaces too.
| arg | type | description |
|---|---|---|
| text | string |
harvest(key: string, assetPath: string) → void
--!desc Copy one finished generation into this slice's voice folder. --!arg key The line key to store it under. --!arg assetPath The `.soundClip` path the service reported. --!return A table with the new path and the clip's audio.info, or nil + reason. --!example Voice.harvest("anselm_attack_1", "/zero/source/generated/audio/Prune_it_back.soundClip")
| arg | type | description |
|---|---|---|
| key | string | |
| assetPath | string |
sweep( ) → void
--!desc Sweep the generated-audio folder and harvest anything that matches a --! line whose clip is still missing. Costs nothing — it buys no audio. --!return An array of harvested keys. --!example Voice.sweep()
generate(limit: number) → any
--!desc Speak up to `limit` still-missing lines, one at a time, waiting for --! each before starting the next so the service does not rate-limit. --!arg limit How many lines to buy on this call. --!return A table of { done, failed, remaining }. --!example Voice.generate(6)
| arg | type | description |
|---|---|---|
| limit | number |
cost( ) → void
--!desc What the whole voice cast costs to buy from scratch, in credits. --!return Two numbers: the line count and the credit cost at 2 per line. --!example local n, credits = Voice.cost()
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.