an.audio.voice_design#
Design a project’s voices from their written notes, then let the writer choose.
A voice document (assets/voices/<ref>.json) may carry the voice in words:
notes (age, accent, pitch, pace, attitude) and, optionally,
sample_text (what the samples say). Voice design turns those words into
candidate voices the writer can LISTEN to, and the writer’s choice becomes the
document’s voice_id. That is how a regional accent gets cast by the one
person who can hear it (a local ear for a local accent), with nobody else
picking from a stock library.
Two steps, both plain functions over injected stores:
design_voice_options(): per voice, ask a designer for previews of its notes speaking its sample text, store each preview’s audio insamplesand return the options manifest ({ref: {"notes", "sample_text", "design_model", "options": [{"option": "A", "generated_voice_id", "voice_id", "sample", "duration_s"}]}}). Withpersist=True(the default) every preview is saved as a durable provider voice at once, because a provider’s previews expire; withpersist=Falseonly the chosen one is, later (fewer voices in the account, but a choice must come before the previews expire).choose_voice_option(): thevoice_idof the chosen option (saving it as a voice first when it was not persisted).choose_in_entry(): the choice made in one manifest entry (thatvoice_id, the designed voice it replaces retired, who chose it and when), returning the voice document and the replaced voice: the step every chooser shares, the CLI’schoose_project_voice()and a connector’s alike.
Two more routes to a voice (an#485). Design from notes can miss a
regional accent entirely (every design of “rural Limerick Irish” came out
English). So a voice document may also carry a library query ({"accent":
"irish", "gender": "male", "age": "middle_aged"}), or an voices design
--library accent=irish,gender=male gives one to every voice: the provider’s
shared voice library, human-tagged by region, is searched and its candidates
join the same manifest as L1, L2, … options (ElevenLabsVoiceLibrary
behind the library= seam; a search and a preview cost nothing). And
an voices audition makes an audition reel per option: the character’s
own lines from the scene, spoken with the film’s TTS provider and model, the
line’s cues as audio tags, 0.6 s apart (audition_voice_options(), the
tts= seam), so the writer hears what the film will sound like, accent
drift of the render model included. The writer’s ear is the judge: an accent
classifier was measured and cannot screen TTS accents (an#485).
A choice is recorded, and a render needs one (an#486). A voice written in
words (notes) is cast by the writer, nobody else: an voices choose
writes chosen_by and chosen_at beside the voice_id
(record_choice()), and a voice document that has notes but no
recorded choice is a render finding, refused under --strict-assets before
anything is synthesized (voice_casting_problem()). A timing draft may
speak a stand-in voice only with an explicit provisional (true, or a
string saying why), which every render report lists.
The project-level forms, design_project_voices() and
choose_project_voice(), keep the manifest in
artifacts/voice_options/<ref>.json, the samples in
artifacts/voice_samples/<ref>_<option>.mp3, and write the chosen voice_id
(and provider) into the voice document. an voices design and an voices
choose are their CLI.
The designer is a seam (designer=): by default
ElevenLabsVoiceDesigner (ElevenLabs Voice Design through the
elevenlabs SDK an’s ElevenLabs TTS already uses; key in ELEVEN_API_KEY).
voxy’s ElevenLabsSpeechModel is a drop-in (designer=voxy.get_speech_model("elevenlabs")),
not the default because voxy brings torch. Anything with these two methods works:
design_voice_previews(description, *, text, model_id) -> [preview] # preview.generated_voice_id, .audio, .duration_s
design_voice(description, *, preview, name) -> profile # profile.segment is the voice id
Designing is billed by the provider; nothing here is called by a render.
>>> class Fake:
... def design_voice_previews(self, description, *, text=None, model_id=None):
... from types import SimpleNamespace as N
... return [N(generated_voice_id=f"g{i}", audio=b"ID3", duration_s=1.0) for i in range(2)]
... def design_voice(self, description, *, preview, name):
... from types import SimpleNamespace as N
... return N(segment="v-" + getattr(preview, "generated_voice_id", preview))
>>> samples = {}
>>> notes = "A man in his fifties from rural Yorkshire, warm and unhurried."
>>> manifest = design_voice_options({"jerry": {"notes": notes}}, samples=samples, designer=Fake())
>>> [(o["option"], o["voice_id"], o["sample"]) for o in manifest["jerry"]["options"]]
[('A', 'v-g0', 'jerry_A'), ('B', 'v-g1', 'jerry_B')]
>>> sorted(samples)
['jerry_A', 'jerry_B']
>>> choose_voice_option(manifest["jerry"], "B", designer=Fake())
'v-g1'
Functions
|
What making |
|
The content key of a reel: what it would sound like depends on exactly these, so a reel with this key is never made (billed) twice. |
|
An audition reel per option of each voice in |
|
An audition reel per option of one voice's manifest |
|
The reels to make for one voice's manifest |
|
Make every reel of |
|
Record a voice picked by hand (from |
|
|
|
Make |
|
Write the chosen option's |
|
The provider |
Who a choice is recorded as when nobody is named: the login name. |
|
|
The designer used when none is given: |
|
The library used when none is given: |
|
Design options for the project's voices (and search the library for the ones with a query); write manifests and samples; return the manifest. |
|
Design options for each voice with notes, and search the library for each voice with a query; return the options manifest. |
|
The voice documents (of |
|
The document's own |
|
The library candidates for |
|
A library query from its CLI spelling, |
|
Why |
|
The voice document with |
|
A sample text from a voice's own dialogue lines, or |
|
The document's |
|
|
Why a render must not speak |
Classes
|
ElevenLabs Voice Design through the |
|
ElevenLabs' shared voice library through the |
|
One candidate from a provider's shared voice library. |
|
One reel to make: an option of one voice, the lines it speaks, and the content key the reel is recorded under (so it is never made twice). |
|
What |
Exceptions
A voice that cannot be designed or chosen (no notes, an unknown option, ...). |
|
Something paid for was not kept (a reel whose option was designed again). |
- class an.audio.voice_design.AuditionJob(ref, option, lines, effects, key)[source]#
Bases:
objectOne reel to make: an option of one voice, the lines it speaks, and the content key the reel is recorded under (so it is never made twice).
- class an.audio.voice_design.ElevenLabsVoiceDesigner(*, api_key=None, client_factory=None, timeout_s=120)[source]#
Bases:
objectElevenLabs Voice Design through the
elevenlabsSDK (what an’s ElevenLabs TTS already uses): the default designer, with voxy’s two-method shape.api_key: defaults to
ELEVEN_API_KEY/ELEVENLABS_API_KEYclient_factory:api_key -> client; tests inject a fake so nothing is billed- delete_voice(voice_id)[source]#
Remove a saved voice from the account (a choice the writer replaced).
- Return type:
- class an.audio.voice_design.ElevenLabsVoiceLibrary(*, api_key=None, client_factory=None, fetch=None, timeout_s=120)[source]#
Bases:
objectElevenLabs’ shared voice library through the
elevenlabsSDK (voices.get_shared): voices other accounts published, human-tagged by accent, age and gender, with a region often in the description (“Cork”, “west of Ireland”). A search and a preview download cost no credit; speaking a library voice at render time is billed like any other.api_key: defaults to
ELEVEN_API_KEY/ELEVENLABS_API_KEYclient_factory:api_key -> client; tests inject a fake so nothing is called fetch:url -> bytesfor a preview (default: a plain HTTP GET)- add(voice_id, owner_id, *, name)[source]#
Add the shared voice to the account under
name; returns its id.A production spoke shared voices by their id directly; ElevenLabs also documents adding one (
voices.share) and avoice_not_foundon a library id means it needs this. Free; not called by anything else here.- Return type:
- class an.audio.voice_design.LibraryVoice(voice_id, name='', description='', accent=None, age=None, gender=None, language=None, preview_url=None, owner_id=None)[source]#
Bases:
objectOne candidate from a provider’s shared voice library.
- class an.audio.voice_design.VoiceChoice(document, previous=None, retired=None)[source]#
Bases:
objectWhat
choose_in_entry()did: the voice document;previous, the voice the choice displaced (what a voice file written before still names;Nonewhen it displaced none); andretired, that voice when it went into theretiredledger (one the choose step itself saved).
- exception an.audio.voice_design.VoiceDesignError[source]#
Bases:
ValueErrorA voice that cannot be designed or chosen (no notes, an unknown option, …).
- exception an.audio.voice_design.VoiceDesignWarning[source]#
Bases:
UserWarningSomething paid for was not kept (a reel whose option was designed again).
- an.audio.voice_design.announce_auditions(jobs, tts)[source]#
What making
jobswill bill, in one sentence (""for none).>>> class T: ... name = "elevenlabs" ... def billed_characters(self, text, **kw): ... return len(text) >>> jobs = [AuditionJob("j", {"option": "A", "voice_id": "v"}, [("Hi.", {}), ("Bye.", {})], {}, "k")] >>> announce_auditions(jobs, T()) 'audition: 1 reel(s) x 2 line(s) = 2 request(s) to elevenlabs, 7 characters'
- Return type:
- an.audio.voice_design.audition_key(voice_id, lines, *, effects=None, gap_s=0.6, tts_name='')[source]#
The content key of a reel: what it would sound like depends on exactly these, so a reel with this key is never made (billed) twice.
>>> k = audition_key("v", [("Hi.", {"model_id": "m"})], tts_name="elevenlabs") >>> k == audition_key("v", [("Hi.", {"model_id": "m"})], tts_name="elevenlabs"), len(k) > 8 (True, True) >>> k != audition_key("v", [("Hi!", {"model_id": "m"})], tts_name="elevenlabs") True
- Return type:
- an.audio.voice_design.audition_project_voices(project_dir, refs=None, *, options=None, tts=None, gap_s=0.6, announce=<object object>, redo=False, scene_file='scene.md')[source]#
An audition reel per option of each voice in
refs(default: every voice with a manifest): the voice’s own lines from the scene, spoken with the film’s TTS provider (tts, default ElevenLabs — the provider the film renders with, so the reel sounds like the film), the voice document’s model, settings and effects, toartifacts/voice_auditions/<ref>_<option>.wav(.../scenes/<stem>/for a scene other thanscene.md, so two scenes’ reels coexist, an#571); the manifest records each reel (audition_path, and per scene underauditions) as soon as it is made. Every voice’s reels are planned and checked before the first request, the whole bill is announced once, and a reel already on record under the same content key is not made again (redomakes them all again). Returns the manifests ofrefs.scene_filetakes the lines from another scene of the project (scene.studio.md, an#554). A reel whose option was designed again (another voice) while it was made is neither kept nor recorded, and the call warns (VoiceDesignWarning, an#649).
- an.audio.voice_design.audition_voice_options(entry, lines, *, reels, tts, ref='', options=None, effects=None, gap_s=0.6, announce=<object object>, redo=False)[source]#
An audition reel per option of one voice’s manifest
entry: every line oflines—(text, synthesize options)pairs, the options being what the film’s pipeline would send (model_id,voice_settings,audio_tagsfrom the line’s cues) — spoken in that option’s voice bytts(the film’s provider), the voice’seffectsapplied,gap_sapart, as one WAV inreelsunder<ref>_<option>. Returns a copy of the entry with each made reel recorded on its option; the input is not changed.plan_auditions()checks everything before the first request; a reel already on record under the same content key is not made again unlessredo(so a second call bills nothing).>>> from types import SimpleNamespace as N >>> import math, struct >>> def tone(n): ... import io, wave ... b = io.BytesIO(); w = wave.open(b, "wb"); w.setnchannels(1); w.setsampwidth(2); w.setframerate(44100) ... w.writeframes(b"".join(struct.pack("<h", int(8000 * math.sin(i / 20))) for i in range(n))); w.close() ... return b.getvalue() >>> class FakeTTS: ... name = "fake" ... def synthesize(self, text, voice_id, **kw): ... return N(bytes_=tone(4410), transcript=text) >>> entry = {"options": [{"option": "A", "voice_id": "v1"}, {"option": "L1", "voice_id": "v2"}]} >>> reels = {} >>> out = audition_voice_options(entry, [("Hi.", {}), ("Bye.", {"audio_tags": ["sad"]})], reels=reels, tts=FakeTTS(), ref="j", announce=None) >>> sorted(reels), [o["audition"] for o in out["options"]] (['j_A', 'j_L1'], ['j_A', 'j_L1']) >>> again = audition_voice_options(out, [("Hi.", {}), ("Bye.", {"audio_tags": ["sad"]})], reels=reels, tts=FakeTTS(), ref="j", announce=None) >>> again == out # on record under the same key: nothing made, nothing billed True
- Return type:
- an.audio.voice_design.cast_project_voice(project_dir, ref, voice_id=None, *, by=None, at=None, provider=None)[source]#
Record a voice picked by hand (from
an voices list, or the document’s ownvoice_id) as the writer’s choice forref:voice_id(default: the one the document already names),chosen_by,chosen_at; no options manifest needed and nothing billed.providersets the document’s when given. Returns the document.- Return type:
- an.audio.voice_design.choose_in_entry(entry, option, *, by=None, designer=None, ref='', at=None, doc=None, in_use=(), name_prefix=None)[source]#
Make
optionthe choice of one voice’s options manifestentry(an#549): the one choose step an’san voices chooseand a connector (reelee’s production pack) share. Returns the voice document (record_choice()ofdoc, default an empty one: a caller that keeps the voice file elsewhere merges these keys into it) and the voice it replaced.entryis updated in place:chosenrecords the option, itsvoice_id,chosen_byandchosen_at. Choosing the option already chosen reuses its voice (nothing is saved), and keeps itschosen_atwhen the same chooser chooses it again and noatis given. Choosing another one names its voice (saved as a provider voice when it was not,choose_voice_option(), named undername_prefix, default the entry’s, and markedsaved_by_choiceandsaved_underthat prefix on its option) and retires the voice it replaces when a choice saved it: its option no longer names it, andentry["retired"]records it ({voice_id, option, name_prefix}, the prefix it was saved under, an#618), never deleted here (a copy of the manifest, or a voice file already written, may still name it: freeing the provider’s slot is a separate, explicit act). A voice saved when the options were designed (persist=True), a library voice and one cast by hand stay named where they are; a choice carried over a re-design (retire_on_replace, an#604) is retired when replaced. A voice inin_use(one another voice document speaks) is never retired: pass the project’s other voices.bydefaults to the login name (seerecord_choice()). A host choosing for a project of its own (a fork) passes itsname_prefixrather than re-stamping the entry’s, which names the voices the entry already saved.>>> from types import SimpleNamespace >>> class Saver: # a designer that saves a preview as voice "v<preview>" ... def design_voice(self, notes, *, preview, name): return SimpleNamespace(voice_id="v" + preview) >>> entry = {"notes": "n", "options": [{"option": "A", "generated_voice_id": "a"}, ... {"option": "B", "generated_voice_id": "b"}]} >>> choose_in_entry(entry, "a", by="noel", at="t1", designer=Saver()).document["voice_id"] 'va' >>> choice = choose_in_entry(entry, "B", by="noel", at="t2", designer=Saver()) >>> choice.previous, choice.retired, [o["voice_id"] for o in entry["options"]] ('va', 'va', [None, 'vb']) >>> choose_in_entry(entry, "B", by="noel").document["chosen_at"] # the same choice again 't2'
A voice keeps the prefix it was saved under when a fork chooses with its own:
>>> src = {"notes": "n", "name_prefix": "src", "options": [ ... {"option": "A", "generated_voice_id": "a"}, {"option": "B", "generated_voice_id": "b"}]} >>> _ = choose_in_entry(src, "A", by="noel", designer=Saver()) >>> choose_in_entry(src, "B", by="ann", designer=Saver(), name_prefix="fork").retired 'va' >>> src["retired"], src["options"][1]["saved_under"], src["name_prefix"] ([{'voice_id': 'va', 'option': 'A', 'name_prefix': 'src'}], 'fork', 'src')
- Return type:
- an.audio.voice_design.choose_project_voice(project_dir, ref, option, *, designer=None, by=None, at=None)[source]#
Write the chosen option’s
voice_idintoassets/voices/<ref>.json, with who chose it (by, default the login name) and when (at, default now), and the choice into its options manifest (choose_in_entry()); return the document.- Return type:
- an.audio.voice_design.choose_voice_option(entry, option, *, ref='', designer=None, name_prefix=None)[source]#
The provider
voice_idofoptionin one voice’s manifestentry.An option that was not persisted is saved as a voice now (its preview must not have expired), named under
name_prefix(default: the entry’s).- Return type:
- an.audio.voice_design.default_chooser()[source]#
Who a choice is recorded as when nobody is named: the login name.
- Return type:
- an.audio.voice_design.default_designer(*, api_key=None)[source]#
The designer used when none is given:
ElevenLabsVoiceDesigner.- Return type:
- an.audio.voice_design.default_library(*, api_key=None)[source]#
The library used when none is given:
ElevenLabsVoiceLibrary.- Return type:
- an.audio.voice_design.design_project_voices(project_dir, refs=None, *, designer=None, model_id='eleven_ttv_v3', persist=True, name_prefix=None, library=None, library_query=None, library_limit=8, design=True, scene_file='scene.md')[source]#
Design options for the project’s voices (and search the library for the ones with a query); write manifests and samples; return the manifest.
A voice document without
sample_textspeaks its own lines from the scene (scene_file: another scene of the project, an#554).library_query(accent=irish,gender=male) applies to every voice without alibraryof its own;design=Falsesearches the library only.
- an.audio.voice_design.design_voice_options(voices, *, samples, refs=None, designer=None, model_id='eleven_ttv_v3', persist=True, name_prefix='an', lines_of=None, library=None, library_query=None, library_limit=8, design=True, previous=None, in_use=())[source]#
Design options for each voice with notes, and search the library for each voice with a query; return the options manifest.
voices:
{ref: voice document}(a project’svoicesstore) samples: where each option’s audio goes, keyed<ref>_<option>(mp3 bytes) refs: the voices to design (default: every one withnotesorlibrary) designer: a two-method designer (default:default_designer()) model_id: the provider’s voice-design model persist: save every option as a durable voice now (else only the chosen one, later) name_prefix: prefix of the saved voices’ names in the provider account lines_of:ref -> that voice's dialogue lines, for a sample text when thedocument has none (else the provider writes one)
- library: the shared-library seam (
default_library()for the CLI), searched for every voice that has a
libraryquery of its own or getslibrary_query. Opt-in: with neitherlibrarynorlibrary_querygiven, a document’slibrarykey is left alone and nothing reaches the network — a caller that passed only adesignersees exactly what it saw before.
library_query: the query for voices without their own (
accent=irish,gender=male) library_limit: at most this many library candidates per voice design: withFalse, no designed previews (library candidates only, nothing billed) previous:{ref: the entry its last design wrote}(a damaged one as anythingthat is not a mapping): each designed again keeps its record (
merge_redesign()), and a damaged one is refused BEFORE anything is billed or saved (an#604)- in_use: voice ids a voice document names, which a re-design never retires;
a caller passing
previousshould pass them (the default, none, would ledger a voice another character speaks)
A voice with
notesgets designed optionsA,B, …; a voice with a query gets library optionsL1,L2, …; one with both gets both in one manifest, so the writer compares them on the same page.- library: the shared-library seam (
- an.audio.voice_design.designable_voices(voices, refs=None)[source]#
The voice documents (of
refs, else all) that carrynotes.Raise
VoiceDesignErrorfor a named ref that is missing or has no usable notes; skip the unnamed ones silently.>>> designable_voices({"a": {"notes": "x" * 30}, "b": {}}) {'a': {'notes': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}}
- an.audio.voice_design.library_query_of(doc, default=None)[source]#
The document’s own
libraryquery, elsedefault, elseNone.>>> library_query_of({"library": {"accent": "irish"}}, {"accent": "scottish"}) {'accent': 'irish'} >>> library_query_of({}, {"accent": "scottish"}), library_query_of({}) is None ({'accent': 'scottish'}, True)
- an.audio.voice_design.library_voice_options(query, *, samples, ref, library=None, limit=8)[source]#
The library candidates for
queryas manifest optionsL<n>, each with its preview insamples(<ref>_L<n>) when the library has one (sampleisNoneotherwise), and the sharing account’s id (owner_id) so the voice can be added to the account later.>>> class Fake: ... def search(self, *, limit, **f): ... return [LibraryVoice("v1", "Dan", "Cork", accent="irish", preview_url="u", owner_id="o")] ... def preview(self, v): ... return b"ID3" >>> samples = {} >>> library_voice_options({"accent": "irish"}, samples=samples, ref="j", library=Fake()) [{'option': 'L1', 'kind': 'library', 'voice_id': 'v1', 'owner_id': 'o', 'name': 'Dan', 'about': 'Cork', 'accent': 'irish', 'age': None, 'gender': None, 'sample': 'j_L1', 'duration_s': None}]
- an.audio.voice_design.merge_redesign(previous, entry, *, in_use=())[source]#
entry(a voice’s options, designed again) keeping what the previous design’s entry recorded (an#604). Itschosenis kept (the voice the voice document names, by whom and when), itsoptioncleared, since this design’s option of that label is another voice, and markedRETIRE_ON_REPLACE_KEYwhen that voice was a designed one, so the choice that replaces it retires it. Itsretiredledger is kept and joined by every voice the previous design saved that nothing names any more: not this design, notchosen, notin_use(a voice document names it), not a library option (another account’s).entryis returned, updated.>>> old = {"name_prefix": "p", "options": [{"option": "A", "voice_id": "v1"}, ... {"option": "B", "voice_id": "v2"}, {"option": "L1", "kind": "library", "voice_id": "pub"}], ... "chosen": {"option": "A", "voice_id": "v1", "chosen_by": "n", "chosen_at": "t"}} >>> new = merge_redesign(old, {"options": [{"option": "A", "voice_id": "v9"}]}) >>> new["chosen"]["option"], new["chosen"][RETIRE_ON_REPLACE_KEY], new["retired"] (None, True, [{'voice_id': 'v2', 'option': 'B', 'name_prefix': 'p'}])
- Return type:
- an.audio.voice_design.parse_library_query(text)[source]#
A library query from its CLI spelling,
accent=irish,gender=male(a mapping passes through; empty isNone).>>> parse_library_query("accent=irish, gender=male") {'accent': 'irish', 'gender': 'male'} >>> parse_library_query("") is None, parse_library_query({"age": "young"}) (True, {'age': 'young'}) >>> parse_library_query("irish") Traceback (most recent call last): ... an.audio.voice_design.VoiceDesignError: library query 'irish': write it as key=value pairs (accent, gender, age, language, search)
- an.audio.voice_design.plan_auditions(entry, lines, *, ref='', options=None, effects=None, gap_s=0.6, tts_name='', redo=False, recorded=None)[source]#
The reels to make for one voice’s manifest
entry, every one checked BEFORE anything is billed: the namedoptionsexist (default: every option with a voice id) and are saved voices, there arelinesto speak, and an option whose recorded reel was made under this very key is skipped unlessredo.recorded(option)says which record to judge that by (default: the option’s own fields; the project forms pass the scene’s own record, an#571). RaisesVoiceDesignErrorfor any problem.- Return type:
- an.audio.voice_design.provisional_reason(doc)[source]#
Why
docspeaks a voice nobody chose (itsprovisional, as text), orNonewhen it is not provisional.>>> provisional_reason({"provisional": "timing draft"}), provisional_reason({"provisional": True}) ('timing draft', 'provisional') >>> provisional_reason({"provisional": False}) is None, provisional_reason({}) is None (True, True)
- an.audio.voice_design.record_choice(doc, voice_id, *, by=None, at=None, provider=None)[source]#
The voice document with
voice_idchosen bybyatat(default: now, UTC):chosen_byandchosen_atbeside thevoice_id, theproviderset when given (None, the default, keeps the document’s: a designed option passesDESIGN_PROVIDER; a hand-picked voice of another provider passes nothing), andprovisionaldropped, since a choice is what it stood in for.bydefaults to the login name, which says nothing about the writer: a connector or an agent choosing on a writer’s behalf passes the writer’s name.>>> doc = record_choice({"notes": "a warm voice", "provisional": True}, "v1", ... by="noel", at="2026-10-20T22:00:00+00:00", provider="elevenlabs") >>> doc == {"notes": "a warm voice", "provider": "elevenlabs", "voice_id": "v1", ... "chosen_by": "noel", "chosen_at": "2026-10-20T22:00:00+00:00"} True >>> record_choice({"provider": "mac_say"}, "Junior", by="noel", at="t")["provider"] 'mac_say'
- Return type:
- an.audio.voice_design.run_auditions(jobs, *, reels, tts, gap_s=0.6, announce=<object object>, keep=None)[source]#
Make every reel of
jobswithtts(synthesize(text, voice_id, \*\*options)per line — billed),gap_sapart, record it on the job’s option (audition,audition_lines,audition_key) and keep it as soon as it is made, so a failure later loses nothing paid for:keep(job, wav), by defaultreels[job.reel] = wav(a caller that also records the reel elsewhere writes both in one step, an#649).announce(default: a line on stderr;Nonefor silence) is told the whole bill first, and the provider is askedcheck_available()before the first request.- Return type:
- an.audio.voice_design.sample_text_from_lines(lines, *, limit=1000)[source]#
A sample text from a voice’s own dialogue lines, or
Nonewhen they are too short for a provider preview (then the provider writes one).>>> sample_text_from_lines(["Hi."]) is None True >>> len(sample_text_from_lines(["That's a big mountain over there, I'd say."] * 5)) >= 100 True
- an.audio.voice_design.sample_text_of(doc, fallback=None)[source]#
The document’s
sample_text(clipped), elsefallback.
- an.audio.voice_design.voice_casting(voice_refs, voices)[source]#
(uncast, provisional): one message per distinct voice ofvoice_refs(the voices a scene’s lines speak with) that a render must not speak as it stands, and one per voice it speaks provisionally. Each message starts withvoice '<ref>'and the uncast ones name the fix.>>> voices = {"j": {"notes": "n", "voice_id": "v"}, "p": {"notes": "n", "voice_id": "v", ... "provisional": "round-2 timing draft"}, "k": {"voice_id": "x"}} >>> uncast, provisional = voice_casting(["j", "p", "k", "j", "ghost"], voices) >>> print(uncast[0]) voice 'j' has a voice_id nobody is recorded as choosing (no chosen_by). Cast it: `an voices design` (options from its notes or a library query), `an voices audition` (the lines in each option's voice), then `an voices choose <option> --by <writer>` (the pick, recorded as chosen_by), or `an voices cast <voice_id> --by <writer>` for a voice picked by hand (`an voices list`); a timing draft may set `provisional: true` on the voice document instead. >>> provisional ["voice 'p' is provisional (round-2 timing draft): choose a voice before the cut"]
- an.audio.voice_design.voice_casting_problem(doc)[source]#
Why a render must not speak
docas it stands, orNone.A voice written in words (
notes) is cast only once a choice is recorded (chosen_bybeside thevoice_id), or it is markedprovisional. A document withoutnotesnames its voice by hand and is not judged here.>>> voice_casting_problem({"voice_id": "v1"}) is None True >>> print(voice_casting_problem({"notes": "a warm voice"})) is written in words but no voice is chosen for it: nothing to speak with >>> print(voice_casting_problem({"notes": "a warm voice", "voice_id": "v1"})) has a voice_id nobody is recorded as choosing (no chosen_by) >>> voice_casting_problem({"notes": "n", "voice_id": "v1", "chosen_by": "noel"}) is None True >>> voice_casting_problem({"notes": "n", "voice_id": "v1", "provisional": "draft"}) is None True >>> voice_casting_problem({"notes": "n", "provisional": True}) is None # provisional WHAT? False