an.audio.cli#

an voices ... — browse a TTS provider’s voices from the shell (an#209).

Thin string-typed wrappers dispatched by typer the way an character ... is; the business logic is browse_voices(), a plain function over the provider factories.

an voices list –provider elevenlabs an voices list –provider elevenlabs –search british an voices list –provider mac_say an voices rescore <project> “He did not ask” # re-choose a line’s take from its cached takes an voices reroll <project> “He did not ask” # synthesize new takes for it (billed) an voices design <project> # design options from each voice’s notes (billed) an voices design <project> –library accent=irish,gender=male –no-design # library candidates by accent (free) an voices audition <project> –voices jerry_voice # the character’s lines in each option’s voice (billed) an voices choose <project> jerry_voice B –by noel # the writer’s pick becomes the voice_id (recorded) an voices cast <project> paul_voice <voice_id> –by noel # a voice picked by hand, recorded the same way an voices import <project> takes/ –transcript takes/ –license cc-by-4.0 –recorded-by “J. Doe”

# a performer’s recording becomes the voice (an#490)

The voice_id column is what a voices-store document’s voice_id takes. rescore and reroll are the only ways a recorded best-of-N take is replaced (an.audio.pipeline.retake_lines()); the next an render does the choosing, and prints what it will bill first.

Functions

browse_voices([provider, search, api_key, make])

The voices provider exposes, optionally filtered by search.

format_voices(voices)

One line per voice: voice_id  name  (labels).

retake(project, line, *[, rescore, tts, ...])

Release the recorded takes of the lines of project containing line.

import_recorded(project, audio[, ...])

Import a performer's recording as the voice of its lines: each line is cut out, matched to the scene's dialogue (or added to --shot), stored with its provenance, and the speaker's character speaks with it — nothing synthesized, nothing billed.

an.audio.cli.browse_voices(provider='elevenlabs', *, search=None, api_key=None, make=<function make_tts>)[source]#

The voices provider exposes, optionally filtered by search.

A provider whose list_voices takes search (ElevenLabs) filters on its server; for the others the filter is a case-insensitive substring over the id, name, accent, description and labels.

make is the provider seam: make(name), or make(name, api_key=api_key) only when a key was given (so a make that takes no key serves every keyless call); default an.audio.providers.make_tts(). api_key=None means the provider’s own default (ElevenLabs: the environment’s key); an empty key is refused (ValueError) rather than read as “none”.

>>> class Fake:
...     name = "fake"
...     def list_voices(self):
...         return [VoiceMeta("v1", "Ada", "fake"),
...                 VoiceMeta("v2", "Bob", "fake", description="adenoidal")]
>>> [v.name for v in browse_voices("fake", search="ad", make=lambda _: Fake())]
['Ada', 'Bob']
Return type:

list[VoiceMeta]

an.audio.cli.format_voices(voices)[source]#

One line per voice: voice_id  name  (labels).

>>> from an.audio.tts import VoiceMeta
>>> print(format_voices([VoiceMeta("abc", "Ada", "x", extra={"labels": {"accent": "british"}})]))
abc  Ada  (accent=british)
Return type:

str

an.audio.cli.import_recorded(project, audio, transcript='', speaker='', speakers='', shot='', voice='', denoise=False, license='', recorded_by='', transcriber='', diarize=False, aligner='', rough_timing=True, overlap_tolerance=0.05, scene='scene.md')[source]#

Import a performer’s recording as the voice of its lines: each line is cut out, matched to the scene’s dialogue (or added to –shot), stored with its provenance, and the speaker’s character speaks with it — nothing synthesized, nothing billed.

project: the project directory audio: the take(s): a file, a directory, a glob, or comma-separated files (one take with several lines, or one file per line) transcript: SRT / WebVTT / TextGrid / word JSON (timed: no transcribing) or plain speaker: text lines; a directory pairs by stem; artifact:transcripts/<key> names one kept in the project’s transcripts store (comma-separate one per take) speaker: the one character every take belongs to speakers: label=character pairs for a transcript’s or diarizer’s labels and file stems, e.g. spk_0=carl,spk_1=ned shot: the shot new lines go into (takes matching no scene line) voice: the recorded voice document to bind (default <speaker>_recorded) denoise: clean each file first (ffmpeg afftdn) license: REQUIRED — the licence or permission code you vouch for (cc0-1.0, cc-by-4.0, all-rights-reserved, unknown) recorded_by: who recorded the take (the performer), for the credits transcriber: the scribed backend when a take must be transcribed (default: scribed’s default) diarize: ask the transcriber for speaker labels (map them with –speakers) aligner: time a plain transcript with a forced aligner, words and phones (for lip-sync): mfa (Montreal Forced Aligner, ARPAbet) or mfa:ipa rough_timing: with –aligner and several lines in one take, time the lines roughly with the transcriber first (–transcriber, billed if that backend is) so each line is aligned in its own interval; –no-rough-timing aligns the whole text as one utterance, never transcribing overlap_tolerance: how far (seconds) one line may run into the next before the two are refused as overlapping speech (raise it for a transcriber’s loose word edges) scene: the scene file whose lines the takes voice (default scene.md; for example scene.studio.md)

Return type:

str

an.audio.cli.retake(project, line, *, rescore=False, tts='elevenlabs', make=<function make_tts>, scene='scene.md')[source]#

Release the recorded takes of the lines of project containing line.

The plain-function core of an voices rescore / an voices reroll: see an.audio.pipeline.retake_lines(). tts must be the provider the line is rendered with (its takes are keyed by it). scene names another scene file of the project (scene.studio.md, an#554). When no dialogue line contains line nothing was released, and the CLI exits 1 (an#559).

Return type:

str