Skip to content

Clone your own voice on your own computer: speak any text in 60+ languages and dub videos into another language in your voice. Fully local. Early version.

210 KB
Raw Blame

Engine protocol (app <-> engine)

The desktop app (crates/desktop/, Rust) starts the ML engine (engine/, Python) as a child process and talks to it over stdin/stdout, one JSON object per line (UTF-8, \n-terminated). The engine writes logs only to stderr. Audio is never sent inline: both sides exchange absolute file paths (WAV, mono, 16-bit PCM unless stated).

This file is the single source of truth. Rust types live in crates/engine-client/src/protocol.rs, Python handlers in engine/src/mimvox_engine/. Change this file first, then both sides.

Process

<python> -m mimvox_engine serve --runtime <runtime.toml> --data-dir <data dir>
  • <python> is the engine virtualenv interpreter named in runtime.toml ([python] engine), with PYTHONPATH=<repo or bundle>/engine/src. The reading presets are found by walking up from the engine sources to the first folder that has presets/<lang>/*.md (or a legacy flat presets/*.md, read as English): <repo>/presets in the repository and <RES>/presets next to <RES>/engine/src in an installed bundle. MIMVOX_PRESETS=<dir> overrides it (the folder that holds the <lang> folders).
  • On start the engine prints exactly one line {"event":"ready","job":null,"data":{...hello result...}} once it can answer requests. Models load in the background (about 20-30 s from a cold start, including a warm-up); models in the ready data is loading for both until the models event says otherwise. On the CPU there is no warm-up at start (one sentence takes minutes there, and a request sent meanwhile would wait behind it): tts is ready once the model is loaded, and the first generation transcribes the voice's clip and builds its prompt itself.
  • The engine exits when stdin closes or on shutdown. Stdout carries the protocol only; logs go to stderr.
  • Requests are handled concurrently; replies may arrive in any order, match them by id.
  • Process model (event-driven). The engine runs on one asyncio event loop; nothing in the engine or its workers polls. Every request is a task; long work (*.generate, Redub, training) is a job task that *.cancel cancels. Blocking work runs in executors (a single-thread GPU executor for in-process model calls, a small IO pool for file/CPU work) or in worker processes (OmniVoice speech, RVC, Whisper/NLLB) whose request queues serialize their model calls. Events and results are written by one writer in order.
  • stdin. The engine (and each worker) moves its protocol pipe to a private descriptor and points its standard input (fd 0 and, on Windows, STD_INPUT_HANDLE) at NUL before reading. On Windows a thread waiting in ReadFile on a synchronous pipe blocks every other request on that pipe's file object, and loading DLLs (import torch) makes one on the standard input handle, so a model load hung until the next line arrived (this was the redub.prepare deadlock). Lines are read by one dedicated thread on Windows and by an asyncio pipe reader elsewhere. A client needs to do nothing for this; it only means the engine never depends on more input arriving.
  • Workers (RVC, speech): child processes with the same JSON-lines framing. The engine side has one owner task per worker that consumes a request queue, writes one request ({"id","op",...}), and awaits its reply; a reader task resolves replies by id and turns progress lines into callbacks. A worker that exits fails every pending request at once (the exit is awaited, not polled) and the next request starts a new process. Workers run ops on one thread and use timers for idle unload/exit. A request may have a time limit and a no-progress limit (any progress line about it starts that one again); past either the worker is killed and the request fails with internal ("the omnivoice worker timed out in synth" / "made no progress for 600 s in synth").
  • shutdown / stdin EOF. The engine answers shutdown with {}, lets requests in flight answer (up to 10 s), stops a running training's Applio process tree (Windows: taskkill /T; the run stays resumable as an interrupted one), cancels the remaining jobs, stops the workers (quit, exit awaited, killed after 5 s) and exits. From the start of the shutdown a worker that exits is not started again: a request it was running fails instead of being retried. A request still running at that point answers cancelled. No child process outlives it.

Command line helper (no running engine needed, prints the voices.import result as JSON):

<python> -m mimvox_engine import --data-dir <data dir> --name <name> [--reference <wav>] [--dataset-dir <dir>]
                                     [--rvc-model <pth>] [--rvc-index <index>] [--language <code>]

Message shapes

Direction Shape
app -> engine request {"id":"<string>","method":"<name>","params":{...}} (params may be omitted)
engine -> app success {"id":"<same>","result":{...}}
engine -> app failure {"id":"<same>","error":{"code":"<snake_case>","message":"<human text>"}}
engine -> app event {"event":"<name>","job":"<job id or null>","data":{...}}

Requests may be sent while others run. Long work (tts.generate, train.start) answers at once with a job id (job-1, job-2, ...) and then reports through events carrying that job. Events without a job have "job":null. Error codes: bad_request, not_found, busy, not_ready, paused, cancelled, no_memory, internal. An unknown method is not_found; a malformed line is bad_request. no_memory: the computer has too little RAM free for the step, or too little in all for speech on the processor (RAM on the CPU); the message says which. A client that does not know a code shows the message. As a last resort a job that crashes without reporting itself emits job.error {"code":"internal","message"}.

Events that are not tied to a request

Event Data When
ready the hello result once, at start
models `{"tts":"ready loading
voice.warm {"id","ok":true,"elapsed_s","reference_language"} or {"id","ok":false,"message"} a voices.warm finished (reference_language: see Reference language)

paused means the models were unloaded on purpose while a voice trains (the GPU and host RAM are handed to Applio); tts.generate and redub answer not_ready until both are ready again after train.done/train.error. tts: no_memory means speech runs on the CPU of a computer with too little RAM in all (RAM on the CPU): the speech model is not loaded at all, tts_message (only then) says why in plain words, and every request that speaks (tts.generate, voices.warm, books, Redub respeak) answers no_memory with that message. It does not change until the engine starts again; the app shows "Not enough memory" with the message, not "Ready".

| redub.prepared | {"ok":true,"device":"cuda|cpu","model":"turbo","elapsed_s"} or {"ok":false,"message"} | a redub.prepare finished |

Job events of the reference-from-media job (voices.media.progress, voices.media.done, voices.media.error) are described in Reference from media.

Job events of audiobooks (book.progress, book.chapter, book.done, book.paused, book.error) are described in Audiobooks.

Job events of the Redub feature (redub.progress, redub.transcript, redub.done, redub.error) are described in the Redub section; audio.export and formats.list in Audio formats, and the events of a video export (video.progress, video.done, video.error) in video.export.

runtime.toml (written by tools/setup/setup.py)

[python]
engine = "/abs/path/runtime/engine/.venv/bin/python"   # runs the engine, the OmniVoice worker and the speech worker
rvc    = "/abs/path/runtime/applio/.venv/bin/python"   # runs the RVC worker and training (only with "training")
holos  = "/abs/path/runtime/holos/.venv/bin/python"    # runs the HolosTTS worker (only with "ukrainian")
voxcpm = "/abs/path/runtime/voxcpm/.venv/bin/python"   # runs the VoxCPM2 worker (only with "voxcpm")
chatterbox = "/abs/path/runtime/chatterbox/.venv/bin/python"  # runs the Chatterbox worker (only with "chatterbox")

[paths]
applio          = "/abs/path/runtime/applio"           # Applio repo with prerequisites downloaded
omnivoice_model = "/abs/path/runtime/models/omnivoice" # k2-fsa/OmniVoice snapshot (3.3 GB)
seed_vc         = "/abs/path/runtime/seed-vc"          # Seed-VC source checkout (zero-shot native accent)
seed_vc_models  = "/abs/path/runtime/models/seed-vc"   # its weights (dit/, bigvgan/, whisper-small/, 1.8 GB)
holos_model     = "/abs/path/runtime/models/holos"     # HolosTTS weights + stanza/ (only with "ukrainian", 0.9 GB)
voxcpm_model    = "/abs/path/runtime/models/voxcpm"    # openbmb/VoxCPM2 snapshot (only with "voxcpm", 4.7 GB)
chatterbox_model = "/abs/path/runtime/models/chatterbox" # ResembleAI/chatterbox files (only with "chatterbox", 3.0 GB)

[device]
backend = "cuda"   # cuda | mps | cpu (detected by setup)
vendor  = "nvidia" # nvidia | amd, with the cuda backend (optional)
# With vendor "amd" setup also writes the card's name and VRAM:
# name    = "AMD Radeon RX 9070 XT"
# vram_gb = 15.9

[setup]
runtime_version = 1 # tools/setup/runtime_version.txt at setup time (missing: 1). Read by the app only: when the
                    # bundled file is higher, the app asks to run setup again.
components = ["speech", "training", "translation", "music_removal"]   # what setup installs; a later run keeps it

An AMD GPU (Linux only) uses the cuda backend: the ROCm build of PyTorch uses the torch.cuda API and the cuda device, so every cuda check in the engine and the app applies to it too.

[python] omnivoice (optional) runs the OmniVoice worker with another interpreter; by default it is the engine's. When omnivoice_model is absent the engine looks in <runtime>/models/omnivoice (next to the Applio folder) and reports tts: missing when nothing is there. Without seed_vc / seed_vc_models the engine looks in <runtime>/seed-vc and <runtime>/models/seed-vc; the converter counts as installed only with every file and setup's .mimvox-setup-ok stamp in the weights folder (hello -> zero_shot_vc). HolosTTS (the ukrainian component) needs [python] holos (without holos_model the engine looks in <runtime>/models/holos) and counts as installed only with its three weight files and setup's .mimvox-setup-ok stamp there. Runtimes of earlier versions had engine in runtime/index-tts/.venv and an indextts path; setup rewrites the file (the old runtime/index-tts is not used any more).

Where the data directory is

The runtime alone is about 30 GB, so it can live on any drive. Setup asks where (default below) and the app finds it in this order:

  1. MIMVOX_DATA environment variable (an absolute path);
  2. the pointer file location.toml in the fixed per-user config folder, content data_dir = "<absolute path>";
  3. the default data directory.
Platform Default data directory location.toml
Windows %LOCALAPPDATA%\mimvox (never Roaming) %LOCALAPPDATA%\mimvox\location.toml
macOS ~/Library/Application Support/mimvox ~/Library/Application Support/mimvox/location.toml
Linux $XDG_DATA_HOME or ~/.local/share, plus /mimvox ${XDG_CONFIG_HOME:-~/.config}/mimvox/location.toml

Setup writes location.toml only when the chosen data directory is not the default one (and removes a stale one when it is the default again). runtime.toml always lives in the data directory itself. Running setup again with an existing runtime in the chosen directory reuses it and only fills in what is missing.

Setup and moving the install (subprocess interface)

setup.cmd / ./setup.sh take --data-dir DIR, --yes, --force and others (--help). Before anything is downloaded setup prints the install location, the free space there and the size (about 30 GB: engine + OmniVoice ~11 GB, Applio/RVC ~12 GB, Redub models ~4.5 GB, music removal ~0.3 GB, zero-shot native accent ~2 GB, plus ~0.1 GB per voice), or "Existing runtime found, nothing big to download". It refuses when the drive has under 34 GB free unless --force. --no-zero-shot-vc leaves out Seed-VC (see Native accent). An existing runtime/index-tts (IndexTTS-2.5 of earlier versions, ~19 GB) is deleted only with --remove-indextts or a "y" at the prompt in an interactive terminal; with --yes setup only prints a hint. Without --yes it asks (interactive; the app opens a terminal running plain setup.cmd/setup.sh, so this prompt is what the user sees); with --yes it needs --data-dir (or MIMVOX_DATA) and never picks a place silently.

Moving an existing install, run by the app as a subprocess after stopping the engine (it refuses while the engine or anything started from the old runtime is running):

setup.cmd --move-to <new dir> [--data-dir <current dir>] [--force]

The current directory defaults to location.toml, then the default directory. The new directory must be empty or absent, and not inside the old one. Output is line based, every line starts with [move] :

Line Meaning
[move] 37% 11.4/31.0 GB copy progress (printed at each percent; a same-volume move is a rename and prints [move] 100% done)
[move] ... (other text) information or warning: ... (for example a console launcher .exe that still holds the old path; the engine does not use them)
[move] done success, exit code 0
[move] failed: <reason> failure, exit code 1 (the old copy is untouched unless the copy was verified)

Steps: refuse if running, check free space, rename (same volume) or copy (other volume, resumable: rerun the same command to continue an interrupted copy), verify (same files and sizes), rewrite absolute paths inside the virtual environments (.pth, editable finders, direct_url.json, pyvenv.cfg, scripts), rewrite runtime.toml, update location.toml, run the quick check, and only then delete the old directory.

Data directory layout (owned by the engine; the app only reads files the engine names)

<data>/voices/<voice_id>/voice.json          # {"id","name","created","preset","language","reference":"reference.wav"} (+ after training or
                                             #  import: "trained":true,"trained_epochs","trained_at","imported"?; while a training runs or is paused: "training_run" /
                                             #  "training_paused", see Pause and resume)
<data>/voices/<voice_id>/reference.wav       # the 15-20 s clip the speech model copies tempo and manner from (picked by dataset.add/remove, or by voices.set_reference)
<data>/voices/<voice_id>/dataset/part<N>.wav # recorded parts (N from 1), trimmed and normalised
<data>/voices/<voice_id>/dataset/meta.json   # per-part quality results, speaking rate, candidate reference windows, the chosen reference,
                                             #  and "media": the media pool (files, best windows), see Reference from media
<data>/voices/<voice_id>/reference_media.wav # optional media pool (voices.reference_from_media): many media files of the speaker,
                                             #  cleaned and joined (mono 16-bit 44.1 kHz, at most 20 min); not a dataset part, never trained on
<data>/tmp/export/<voice_id>-<sha256[:12]>.mimvoice  # voices.export's default archive (a voice bundle)
<data>/tmp/import/<random>/                  # a voice bundle being unpacked by voices.import (moved to voices/ when verified)
<data>/tmp/refcand/<voice_id>/               # preview WAVs of voices.reference_candidates (rewritten on every call)
<data>/voices/<voice_id>/rvc/model.pth       # trained or imported RVC model
<data>/voices/<voice_id>/rvc/model.index
<data>/outputs/<YYYYMMDD_HHMMSS>.<ext>       # generated speech: ONE file per result in the job's `output_format` (default
                                             #  wav; 44.1 kHz mono, opus 48 kHz; a `_2`, `_3` suffix on a name clash)
<data>/outputs/redub_<YYYYMMDD_HHMMSS>.<ext> # Redub results (same rules); a video output adds
                                             #  redub_<same stamp>.<mp4|mov|m4v|mkv|webm|avi> next to it
<data>/outputs/<same stem>.result.json       # the sidecar of every Speak / Redub result (what made it), see Saved results
<data>/tmp/redub_sep_<key>/                  # Redub's voice / background stems of one source (vocals.npy, background.npy:
                                             #  float32 (channels, n) at 44.1 kHz); only the latest file is kept
<data>/tmp/play/<name>.wav                   # playback WAV of a result saved in another format than wav (the app plays WAV
                                             #  only; same name as the saved file; written with the result or by
                                             #  outputs.play; gone at the next engine start)
<data>/tmp/covers/<hash>.<ext>               # cover images of imported documents (text.import meta.cover)
<data>/runtime/models/whisper/               # Whisper turbo (large-v3-turbo.pt, 1.6 GB), fetched by setup (else on the first Redub)
<data>/runtime/models/nllb-200-distilled-600M/  # NLLB-200 translation model (2.5 GB), fetched by setup with `hf download`; never auto-downloaded
<data>/runtime/models/nllb-200-distilled-1.3B/  # optional better translation model (fp16 model.safetensors, 2.7 GB; a 5.5 GB fp32
                                             #  download that setup converts), by default only with an NVIDIA GPU; never auto-downloaded
<data>/runtime/models/demucs/hdemucs_high_trained.pt  # Hybrid Demucs (torchaudio HDEMUCS_HIGH_MUSDB_PLUS, 335 MB, SHA-256
                                             #  a004b279...7816) for remove_music; fetched by setup over HTTPS (resumable
                                             #  .part file next to it); never auto-downloaded, missing -> music not removed
<data>/tmp/separate-<job>/                   # mix.npy / vocals.npy of the file being separated (deleted after each file)
<data>/runtime/engine/.venv/                 # the engine environment (setup): engine, OmniVoice worker, speech worker
<data>/runtime/models/omnivoice/             # OmniVoice weights k2-fsa/OmniVoice (3.3 GB), fetched by setup with `hf download`; never auto-downloaded
<data>/voices/<voice_id>/reference.omnivoice.json  # OmniVoice's cut of reference.wav: {"version","sig":[mtime_ns,size],"start","end","text","language"}
                                             #  (whole clip up to 12 s, else 7-12 s of whole sentences, + Whisper transcript and Whisper's detected
                                             #  language; rebuilt when it changes; sidecars written by earlier versions have no "language")
<data>/voices/<voice_id>/reference_<lang>.wav  # optional per-language reference (e.g. reference_uk.wav, 7-12 s of speech in that
                                             #  language); OmniVoice uses it instead of reference.wav for <lang> (+ its own .omnivoice.json)
<data>/books/<book_id>/book.json             # an audiobook project: title, settings, chapters with their texts (see Audiobooks)
<data>/books/<book_id>/state.json            # its progress: chapters done, the current chapter's next segment and PCM length
<data>/books/<book_id>/work/<NNN>.pcm         # the chapter being read: 16-bit mono 44.1 kHz PCM, appended per segment
<data>/books/<book_id>/work/<NNN>.segments.json  # that chapter's segments, fixed when it starts
<data>/books/<book_id>/stats/<NNN>.json      # per-segment measures of a finished chapter (loudness, pitch, pauses, retries)
<data>/books/<book_id>/segments/<NNN>.json   # each segment's text and speech times in a finished chapter's file (see Output files)
<data>/outputs/books/<book title>/<NN> - <chapter title>.<ext>  # one file per chapter (+ <book title>.m4b with "m4b")
<data>/tmp/                                  # scratch (job chunks, training logs), wiped at every engine start
<data>/engine.lock                           # OS file lock held by the app or mimvox-server while its engine runs (and by the engine on Unix)
<data>/api/token                             # HTTP API token, user-only (see HTTP API)
<data>/api/uploads/<uuid>-<name>             # files sent to POST /files, deleted after 24 h

Voice ids are [a-z0-9][a-z0-9_-]*, made from the name (Anna -> anna, a second one anna-2). Names in another script are transliterated first: Cyrillic by the Ukrainian national system (KMU 2010; Мій голос -> mii-holos, Згода -> zghoda, word-initial є ї й ю я -> ye yi y yu ya; Russian/Belarusian/other Cyrillic letters too), Greek letters, Latin accents dropped (Zoë -> zoe, ß -> ss); a name with nothing left gives voice.

Methods

hello -> engine info

{} -> {"version":"0.1.0","device":{"backend":"cuda|mps|cpu","name":"NVIDIA GeForce RTX 4070","vram_gb":12.0,"vendor":"nvidia"}, "models":{"tts":"ready|loading|paused|missing|no_memory","rvc":"ready|loading|paused|missing","tts_message"?}, "languages":[{"code":"en","name":"English","native":"English","common":true},{"code":"uk","name":"Ukrainian", "native":"Українська","common":true},...],"translators":["nllb-1.3b","nllb-600m"],"zero_shot_vc":true, "components":["speech","training","translation","better_translation","native_accent","music_removal","ukrainian"], "components_off":[],"speech_models":[{"id":"omnivoice","name":"OmniVoice","languages":["ar","as",...],"design":true}, {"id":"voxcpm","name":"VoxCPM2","languages":[...],"design":true}]}

  • languages: every language the installed speech models speak (see Speech model and languages), name in English, native in the language itself, the common ones first (common: true, in the order en uk de fr es pl ro it pt cs ru), then the rest by English name. The same list is in the ready line and answers tts.languages {} -> {"languages":[...]}.
  • device.vendor is [device] vendor from runtime.toml, left out when it is not set. The app shows the backend as ROCm for amd.
  • device.name is read from nvidia-smi for CUDA on NVIDIA ("NVIDIA GPU" when that fails), from runtime.toml for AMD ("AMD GPU" when it is missing), "Apple Silicon GPU" for MPS and "CPU" for CPU. vram_gb is the total VRAM rounded to 0.1 and is 0.0 for MPS and CPU.
  • models: loading until the model is loaded, missing when it could not be loaded, no_memory (with tts_message) when the CPU has too little RAM for it. The models event says ready only after the warm-up (none on the CPU); a request sent during the warm-up is accepted and waits behind it (a few seconds on a GPU).
  • translators: the Redub translation models installed, best first: nllb-1.3b (NLLB-200 distilled 1.3B, "better") and/or nllb-600m (NLLB-200 distilled 600M, "faster"); [] when none is. Read at engine start (setup runs while the app is closed). See Translation.
  • zero_shot_vc: setup installed the zero-shot voice converter (Seed-VC), so accent: "native-us" also works for an untrained voice (see Native accent). Read at engine start.
  • components: the parts of the runtime that are installed, from the files on disk (setup's COMPONENTS): speech (the engine environment and Whisper: always there in a complete runtime), omnivoice (the OmniVoice weights), training (Applio/RVC: Train, voice match, Redub's Convert voice), translation (NLLB-200 600M: Redub's Translate & dub), better_translation (NLLB-200 1.3B), native_accent (Seed-VC), music_removal (Hybrid Demucs) and ukrainian (HolosTTS: Ukrainian with exact word stress, see Ukrainian with exact stress). The app offers to install a missing one where it is needed (setup --add <component>). omnivoice, voxcpm and chatterbox are the voice-cloning models, at least one of them installed (see Other voice-cloning models). Without training runtime.toml has no [python] rvc / [paths] applio and models.rvc is missing. Read at engine start.
  • speech_models: the installed and turned-on voice-cloning models tts.generate and book.start may name in model (omnivoice, voxcpm, chatterbox, in that order), each with the language codes it speaks and design: it makes voices from a description (voices.design; OmniVoice and VoxCPM2). languages is their union, plus Ukrainian with HolosTTS.
  • components_off: installed parts the user turned off (<data>/components.json, {"off":[...]}). They are left out of components, translators and zero_shot_vc, and the engine does not use them: no HolosTTS, no Seed-VC, no RVC worker, no translator, no music removal. Read at engine start.

components.set

{"id":"<optional component>","on":true|false} -> {"off":[...],"restart":true}: turns an installed part on or off in components.json. It takes effect when the engine starts again, so the app restarts it. speech and the last voice-cloning model that is on cannot be turned off (bad_request); setup refuses to remove the last one too. Removing a part is setup's job: setup --remove <component> deletes its folders and rewrites runtime.toml; the app stops the engine first, since running workers keep the files open.

voices.list

{} -> {"voices":[{"id","name","created","preset","language":"en","dataset_minutes":6.4,"parts":5,"trained":true, "trained_epochs":300,"trained_at":"2026-11-11T10:20:30","training_paused":null,"references":["uk"], "reference_language":"uk","reference_languages":{"uk":"uk"}}]}, oldest first. references lists the languages that have their own reference clip (reference_<lang>.wav, see Per-language references). reference_language is the language actually spoken in reference.wav, detected by the speech worker (null until it has transcribed the current clip), and reference_languages the same for every reference_<lang>.wav ({lang: detected or null}); see Reference language. Neither changes language. trained_epochs and trained_at are null when the voice has no RVC model (or when the number is unknown). created is UTC ISO 8601 (...Z), trained_at is local time without zone. preset is the preset id the voice was recorded with or null. language is the language the voice was recorded in (language code; "en" for voices made before languages existed): the preset preset is looked up in that language (for the reference-clip part titles). training_paused is null or {"epoch","total_epochs","paused_at","interrupted"}: a training of this voice is paused (or was interrupted by a closed or crashed app, interrupted: true) and epoch is the epoch of the saved checkpoint where train.resume continues (see Pause and resume).

voices.create / voices.rename / voices.delete

{"name","preset"?,"language"?} -> {"voice":{...as in list...}} (a new voice has no dataset and no reference; language defaults to "en", "auto" also means "en", an unsupported code is bad_request; a voice made from media files may get another language the speech model speaks from media.combine) · voices.rename {"id","name"?,"language"?,"book_role"?} (book_role: narrator, men or women, the lines a book voice reads) -> {"voice":{...}} (name renames; language changes the recording language, e.g. when the first texts read into a still empty voice are in another language; at least one of the two) · {"id"} -> {} (removes the whole folder). Names are trimmed to 80 characters. not_found for an unknown id.

voices.import (existing recordings and model; no retraining)

{"name","reference_path"?,"dataset_dir"?,"rvc_model"?,"rvc_index"?,"preset"?,"language"?,"book"?,"book_role"?,"into"?} (into: the id of a voice whose reference is replaced by reference_path, keeping its id) -> {"voice":{...as in list...}}

  • book and book_role (narrator, men, women) mark a voice Book made for a book; they are stored in voice.json and returned by voices.list (null for other voices), so the app lists such voices apart.
  • Creates a voice, then: every part<N>.<ext> in dataset_dir (any importable extension, wav by default) goes through dataset.add (trim, normalise, verdict; the reference is chosen by it); reference_path (any importable format), when given, replaces reference.wav as it is (converted to mono 16-bit WAV, no trimming; a later dataset.add/dataset.remove picks the reference again); rvc_model (and rvc_index) are copied to rvc/model.pth / rvc/model.index and the voice is marked trained with trained_epochs read from a ..._<N>e_... file name when present and "imported":true in voice.json.
  • Needs at least a reference_path or a dataset_dir; rvc_index needs rvc_model. Errors: bad_request, not_found (a path is missing). On any failure the half-made voice is removed again.
  • rvc_model must be an RVC v1/v2 or Applio voice model: a PyTorch file (zip or the legacy format) whose pickle names weight, config and emb_g.weight. Only the pickle's opcodes are read (pickletools), nothing is unpickled; anything else (a .zip holding the model, a G_/D_ training checkpoint, another kind of .pth) is bad_request with a message for the user, before the voice is made.
  • {"bundle","name"?} imports a voice bundle instead (see Voice bundles); bundle cannot be combined with the four paths above.

voices.design / voices.design_cancel / voices.design_takes / voices.design_delete (a new voice from a description)

{"model","language","text","description"?,"exact_stress"?:true,"loudness"?:-23} -> a take: {"id","path","reference","duration_s","model","language","description","text","exact_stress","created","when"} (when: local date and time, YYYY-MM-DD HH:MM:SS)

  • Speaks text in a new voice made from description, with no reference clip, and keeps it as a take in <data>/design/<id>/ (voice.wav, speech.wav when HolosTTS read it, take.json); only the last 40 takes are kept. path is the clip to play (WAV; audio.export writes it in another format), reference the designed voice: voices.import {"name","reference_path":reference,"language"} keeps it as a voice.
  • model: omnivoice or voxcpm (a model whose speech_models entry has design); absent or auto: the first of them installed that speaks language (OmniVoice before VoxCPM2). description for voxcpm is any words ("a deep, calm male voice"); for omnivoice it is comma-separated OmniVoice terms: gender (male, female), age (child, teenager, young adult, middle-aged, elderly), pitch (very low pitch ... very high pitch), whisper and, for English, an accent (american accent, british accent, ...). Empty lets the model choose. text has no length limit (OmniVoice reads a long one in pieces, one after another, in the voice of the first), description at most 400.
  • loudness: LUFS from -40 to -10 that every take is brought to (the designed clip and HolosTTS's reading), less where a peak would pass -1 dBFS. VoxCPM2 makes takes from about -30 to -42 LUFS on its own, OmniVoice about -24.
  • Ukrainian with exact_stress and HolosTTS installed: HolosTTS reads text in the designed voice (and the zero-shot converter brings its timbre back when installed), as tts.generate reads Ukrainian; path is that reading.
  • Before VoxCPM2's first load for a design, the other idle workers stop: loading beside them ran out of VRAM.
  • Whisper checks each OmniVoice take: it hears one stretch of a long take, matched against the part of text it fits best; one that matches less than 60 % (OmniVoice now and then makes only hiss) is made again, up to 3 times; clear says whether the kept take passed. VoxCPM2 takes are not heard (clear null): beside it Whisper has no room on a 12 GB card. A VoxCPM2 take that hums (a band of its pauses, usually near 800 Hz, 10 dB or more over its neighbours) is made again, up to 3 times.
  • It holds the one generation slot while it works: tts.generate, books and Redub are refused with busy ("Design is making a voice") meanwhile, as it is while they run.
  • Errors: bad_request (another model, a language the model does not speak, empty text, an OmniVoice term it does not know), not_ready (not installed or still loading), busy (a generation or Redub job is running), no_memory. A failed take leaves no folder.
  • voices.design_cancel {} -> {"cancelled"}: stops the take being made; voices.design then answers cancelled and keeps nothing. false when no take was being made.
  • voices.design_takes {} -> {"takes":[...]}, newest first. voices.design_delete {"id"} or {"all":true} -> {"takes":[...]} left: deletes one take or every take (voices kept from them stay); not_found for an unknown id.

Voice bundles (voices.export / voices.import bundle)

A voice bundle is one archive with what a voice needs to speak on another machine.

voices.export {"id","dest"?} -> {"path","sha256","bytes","files":[{"path","bytes","sha256"}],"engine"}: writes the bundle to dest (an absolute file path, replaced when it exists) or, by default, to <data>/tmp/export/<id>-<sha256[:12]>.mimvoice (so GET /files serves it; <data>/tmp is wiped at the next engine start). sha256 and bytes are those of the archive file, files its voice files, engine the engine version (not in the archive). Errors: not_found (voice), bad_request (no id, no reference.wav yet, dest relative or a folder, a file over the import limits below).

  • Contents (paths inside the voice folder): voice.json, reference.wav and reference.omnivoice.json, every reference_<lang>.wav and reference_<lang>.omnivoice.json, rvc/model.pth and rvc/model.index; each only when present except voice.json and reference.wav, a sidecar only while it is valid for its clip. Never the dataset (dataset/), the media pool (reference_media.wav) or training checkpoints. voice.json is stored without training_run / training_paused.
  • Format: a zip, every member stored (no compression), dated 1980-01-01 00:00:00, mode 0644, Unix; the files in sorted order, then manifest.json: {"format":"mimvox-voice","version":1,"id","name", "files":[{"path","bytes","sha256"}]} (files as in the answer). voice.json and manifest.json are UTF-8 JSON with sorted keys, 2-space indent and a final newline.
  • Hash rule: the bundle's hash is the SHA-256 of the archive file. It depends only on the voice's content: the same voice files (same bytes) and voice id give the same archive, whatever the files' times or the engine version; exporting a bundle imported under the same id gives it again. A new bundle version would change it.

voices.import {"bundle","name"?} -> {"voice":{...as in list...}}: bundle is a path on the engine's machine (an upload's <data>/api/uploads/... path too). The archive is refused (bad_request, nothing created) when a member name is absolute, has .., ., \, : or an empty part, is not one of the contents above, is there twice, is larger than 1 MiB (.json) or 2 GiB (others, 4 GiB together); when manifest.json is missing, of another format or a newer version, lists other files than the archive holds, or lacks voice.json / reference.wav; when a member's size or SHA-256 differs from the manifest; or when voice.json is unusable or a sidecar names an impossible time. The voice keeps the bundle's id when no voice has it, else gets a new one made from the name as in voices.create; name renames it. Sidecars are kept and each clip gets the modification time its sidecar names, so they usually stay valid; on a filesystem with coarser times (NTFS: 100 ns) the clip's transcript and language may be worked out again on first use. The voice has no dataset; it is trained when the bundle has rvc/model.pth. Errors: bad_request, not_found (no such file).

voices.warm

{"id"} -> {"warming":true} | {"warming":false,"reason":"already_warm|busy"}. Call it when the user selects a voice. The voice.warm event that ends it carries reference_language (the detected language of reference.wav, see Reference language; the warm-up transcribes a new clip, or has the worker detect the language of an older sidecar whose transcript the script fallback cannot place): it computes the speaker conditioning of the voice's reference.wav and, for a trained voice, loads its RVC model and index, in the background (5-22 s, depending on what is already loaded; the first chunk of the next tts.generate then takes about 5 s instead of about 26 s) and ends with the voice.warm event. Call it again after the models have reloaded (the models event shows ready again after a training), because the reload drops the warm state. busy means a generation is running (it warms the voice itself). On the CPU it only transcribes the clip (the first time) and builds the voice prompt, which the first generation needs anyway: no warm-up sentence and no RVC model load, each of which takes minutes there and would hold up a generation sent meanwhile. A warm-up that fails ends with {"ok":false,"message"}, the message in plain words (e.g. the no_memory one). Errors: not_found (voice, or no reference.wav yet), not_ready (speech model not loaded or handed over to training), no_memory (tts is no_memory).

Reference clip (voices.reference_candidates / voices.set_reference)

The speech model copies the tempo and manner of reference.wav, so a slow or halting clip makes the cloned voice slow.

Automatic pick (dataset.add / dataset.remove, CPU-light, numpy/scipy only). Each part is analysed once into up to 10 candidate windows of 15-20 s (cut in pauses of 200 ms or more; widened to 30 s, then fixed windows, when a part has none) stored in dataset/meta.json (parts.<n>.rate, parts.<n>.cands). Per window: rate = syllable nuclei (peaks of the smoothed 10 ms energy envelope, 70 ms apart, 3 dB prominence) per second of active time (window minus gaps of 400 ms or more), pauses = fraction of the window spent in gaps of 400 ms or more (0-1), snr_db = 90th minus 10th percentile of the frame level. The voice's median rate is the median of the per-part rates. Score = 0.5 * min(snr, 40) - 50 * pauses - 30 * |ln(rate / median)| - 0.2 * |duration - 17.5| minus 10 when the part's preset title suggests unnatural reading (tongue twisters, questions, numbers, dates, times, spelling) minus 40 for clipping; parts rated bad are skipped (unless all are). The best window becomes reference.wav. An unchanged pick is not rewritten (a new file makes the speech model condition on the speaker again). A manual pick is kept until its part is removed or re-recorded.

voices.reference_candidates {"id"} -> {"candidates":[{"source":"part|media","file","part","title","start_s","end_s","duration_s","rate","pauses", "snr_db","hint":"natural|slow|fast","recommended":bool,"is_current":bool,"preview_path"}],"current":{...}|null, "rate_median","media":{...}|null,"reference_language":"uk"|null}: the best 5 windows over all parts (at most 2 per part, no overlaps), best first (the first is the automatic pick, recommended). rate is syllables per second, pauses a fraction (0.12 or more is "many pauses"), hint compares rate with rate_median (under 0.88 of it slow, over 1.12 fast). title is the reading-text title of the part (null for a voice without a known preset). preview_path: a WAV written to <data>/tmp/refcand/<id>/ (rewritten on every call). current describes reference.wav with the same keys plus "manual":bool (its preview_path is reference.wav itself); part is null when no part explains the file (imported reference). reference_language is the detected language of reference.wav (see Reference language). candidates is empty for a voice without recordings. Parts stored before this analysis existed are analysed on the first call (a second or two). Errors: bad_request, not_found (voice). Part candidates have "source":"part" and "file":null. When the voice has a media pool, its best windows follow the part candidates (up to 5, at most 2 per file when the pool has 3 or more files) with "source":"media", "part":null, file (1-based index of the file in the request's paths), title (the file name) and start_s/end_s in the pool; the first of them is recommended, is_current marks the window in the pool's target file, hint compares with the pool's own median rate. media summarises the pool: {"files","duration_s","language":null|"<code>","target":"reference.wav"| "reference_<code>.wav","created","skipped"} (null without a pool). current from the pool has "source":"media", file, title (and start_s/end_s in the pool).

voices.set_reference {"id","part","start_s","end_s"} -> {"reference":{"part","start_s","end_s","duration_s","manual":true, "rate","pauses"},"warming":bool}: cuts that range (3-40 s; clamped to the part) into reference.wav and records it as a manual choice. The speaker-conditioning cache is dropped, and the existing voices.warm path is started (warming tells whether it started; voice.warm ends it), so the next generation uses the new clip. The next tts.generate of that voice re-conditions at the first segment otherwise (about 20 s). Errors: bad_request, not_found (voice or part), busy (a generation is running).

voices.set_reference {"id","source":"media","start_s","end_s"} -> {"reference":{"source":"media","start_s","end_s", "duration_s","manual":true,"pool","file","title","rate","pauses","snr_db"},"target":"reference.wav"|"reference_<code>.wav", "language":null|"<code>","warming":bool}: cuts that range of the media pool (3-40 s, clamped) into the pool's target (reference.wav when the pool was made for the voice's own language, else reference_<language>.wav), deletes the target's .omnivoice.json, drops the conditioning cache and (for reference.wav) starts voices.warm. Errors: bad_request, not_found (voice, or no media pool), busy.

A manual choice from the media pool (meta.json reference with "source":"media") is never replaced by dataset.add / dataset.remove; if reference.wav goes missing it is cut again from the pool (when it is still the same pool).

  • App side (not part of the wire protocol). The Speak "Style" panel (shared by Redub) has a Speed slider, 0.8x ("Slower") to 1.3x ("Faster"), step 0.05, default 1.0x; its value is sent as speed with tts.generate and redub.render (respeak) and remembered as speed in <data>/settings.json. On the Voices screen the active voice's card has a "Reference clip" section: the clip in use (part, title, "Natural pace" / "Slow" / "Fast" badge, pause note) with a play button, and "Choose..." opening a list of the voices.reference_candidates with play buttons and "Use this one" (voices.set_reference). The candidates are fetched when the Voices screen opens and after a change.

Per-language references (voices.add_reference / voices.remove_reference)

A voice speaks every language of the speech model, with the accent of its reference clip. A short clip in another language (about 10 s, read in that language) is stored next to reference.wav and used for speech in that language.

voices.add_reference {"id","language","path"} -> {"language":"uk","duration_s":10.4,"references":["de","uk"]}: path is any importable audio file (a recording of the app, an imported file). It is converted to mono, DC-removed, trimmed at both ends (the same trim as dataset.add) and normalised, then written to reference_<language>.wav (an existing one is replaced). The speaker-conditioning cache is dropped. language must be a language the speech model speaks. Needs 3-40 s of speech after trimming (bad_request otherwise; about 10 s is best). Errors: bad_request, not_found (voice or file), busy (a generation is running).

voices.remove_reference {"id","language"} -> {"references":[...]}: deletes reference_<language>.wav and its .omnivoice.json. Errors: bad_request, not_found (voice, or no such reference), busy.

  • App side. The Voices card's "Reference clip" section lists the languages with a clip (play, remove) and "Add a language" (language picker): a native sample text to read (the first sentences of that language's quick preset, or a built-in sentence), record with the Record screen's recorder or import a file, recording.check (expected_s 10), then "Use for " (voices.add_reference). Speak shows "Record a reference" when it speaks a language the voice was not recorded in and has no clip for.

Combine media files (media.combine)

media.combine {"paths":["...",...],"remove_music"?,"language"?,"voice_id"?} -> {"path","duration_s","files":[{"name", "duration_s","truncated","music_removed"}],"skipped":[{"name","path","reason"}],"unused":["name",...],"language", "language_set","music_removed","music_files","music_reason","music_device"}. Joins many audio / video files of one speaker into one mono 16-bit 44.1 kHz WAV under <data>/tmp/combined/, cleaned like the media pool below (background music removed when remove_music says so, DC removed, trimmed, long pauses shortened, loudness normalised, 0.4 s between files, at most 20 minutes; files past that are unused). remove_music and the music_* fields are as in Reference from media. Files that cannot be read or have no clear speech are skipped; none usable -> bad_request. The app's Record screen imports the result as one take (recording.check -> dataset.add); it sends the remove_music the user last chose on the Voices screen, or nothing ("auto") when they never did. It is a plain request (no progress events).

  • language: "auto" asks which language is spoken in the cleaned (and separated) result; omitted or null, nothing is detected (language null, language_set false); anything else is bad_request. Whisper turbo (the speech worker's detect_language) hears up to 5 windows of 30 s spread evenly over the whole result (3 without the GPU: no CUDA, or a training holds it), each window's language probabilities are summed, weighted by its length, and the winner is language when it has at least half of the total and the speech model speaks it (else null). Without the Whisper model, or when the worker fails, language is null and the request goes on.
  • voice_id (with language "auto"): a voice that has no recordings (dataset/part*.wav) and no trained model takes the detected language as its language in voice.json (language_set true); it may then be any language the speech model speaks, not only a reading language. A voice with recordings keeps its own, and nothing is detected for it. not_found for an unknown voice.
  • App side. Record's "Use recordings you already have" creates the new voice (voices.create with the reading language as a stand-in), sends media.combine with "language":"auto" and its voice_id (the same for "More recordings of" an empty active voice), then stores the result with dataset.add; when language_set, the result card says "Language: (heard in the files)." and the voice list is read again.

Reference from media (voices.reference_from_media / voices.media_cancel / voices.clear_media)

The speech model clones from one short clip, so one noisy source makes a metallic clone. Instead, many audio / video files of the same speaker (any importable format) are combined and the cleanest window becomes the reference. numpy/scipy and ffmpeg, plus the speech worker's separate_vocals (Hybrid Demucs) when background music is removed.

voices.reference_from_media {"id","paths":["...",...],"language"?,"remove_music"?} -> {"job","files":n} at once, then events.

  • language: omitted, "", "auto" or the voice's own language: the result is reference.wav (a manual choice, recorded in meta.json reference with "source":"media"). Another speech language: reference_<language>.wav (like voices.add_reference; voices.list then lists it in references).
  • remove_music: true (separate every file), false (never) or "auto" (the default; null too): a video file (by extension: mp4, mkv, mov, webm, avi and aliases) whose decoded audio has an SNR under 35 dB (something plays under the voice; a clean recording measures 40-60 dB) is separated, and only when the engine runs on CUDA and no training holds the GPU. Anything else -> bad_request. A separated file keeps only its vocals: the speech worker's separate_vocals (torchaudio's Hybrid Demucs, HDEMUCS_HIGH_MUSDB_PLUS, vocals stem), right after decoding and before every step below. When the model file is missing (an install from before this feature: run setup again) or the worker fails, the files are used as decoded and the job goes on: separation is never a reason for a job to fail.
  • Per file, in order, on the IO pool: decode to mono 44.1 kHz (only as far as the pool still has room plus 2 min), separate (see remove_music), remove DC, trim silence at both ends (as dataset.add), shorten inner silences longer than 0.7 s to 0.3 s (only when the file's SNR is 15 dB or more), normalise loudness (as dataset.add). A file that cannot be read, has no audio track, no clear speech or under 3 s of speech is skipped (listed with a reason) instead of failing the job.
  • The cleaned files are joined with 0.4 s gaps into reference_media.wav (mono 16-bit, 44.1 kHz). The pool stops at 20 minutes: a long file is cut at a pause, later files are listed as unused.
  • Each file is analysed on its own (the pace / SNR analysis of Reference clip) into pause-aligned windows of 8-12 s (the speech model uses a clip of up to 12 s whole), so no window spans two files. Score = 0.5 * min(snr, 40) - 50 * pauses - 30 * |ln(rate / median)| - 0.2 * |duration - 10| (minus 40 for a clipping file); median is the median rate of the pool's files. The best 24 distinct windows are stored in meta.json media.cands; the best one is written to the target, its .omnivoice.json deleted, the conditioning cache dropped and (for reference.wav) voices.warm started.
  • The pool, meta.json media and the reference are installed together at the end; a cancelled or failed job changes nothing. A new job replaces the previous pool. The dataset (training data) is never touched.
  • Events: voices.media.progress {"id","stage":"decode|separate|combine|analyse|apply","pct":0-100,"files":n,"file"?, "name"?} (file 1-based and name while a file is decoded, separated and cleaned: decode and separate share 0-85, file k of n taking its 1/n of it; separate is file k's middle 80 %, loading the model included), then voices.media.done {"id","files":<used>,"duration_s":<pool>,"language":null|"<code>","target","applied":bool, "reference":{...as in set_reference...}|null,"warming":bool,"preview_path":<the target>|null,"skipped":[{"name","path", "reason"}],"unused":["<name>"],"truncated":["<name>"],"message":null|"<text>","elapsed_s","music_removed":bool, "music_files":<files separated>,"music_reason":null|"<text>","music_device":null|"cuda"|"cpu"} or voices.media.error {"code","message","skipped"?,"music_*"?} (cancelled; bad_request "None of the files has usable speech." with skipped and the music_* fields; not_found, internal). music_reason says why no file was separated: "turned off", "no background sound found under the voice" (auto), "no GPU for it (tick Remove background music to run it on the CPU)" (auto), "the music-removal model is not installed (run setup again)", "music removal failed (<message>)" (also set when some files were separated before the worker failed). Each meta.json media.files[] entry has music_removed and media.music_removed counts the separated files. applied is false (with a message) when a generation started meanwhile (pick a clip with voices.set_reference later) or no 8-12 s window was found.
  • Errors at start: bad_request (paths not a non-empty list of strings, more than 500 files, language not a speech language), not_found (voice), busy (a generation is running, or a media job already runs for this voice).
  • Memory: one file is decoded at a time (at most about 22 min of float32 audio, ~230 MB) and the pool is kept as 16-bit. A separated file also goes to <data>/tmp/separate-<job>/ as .npy (the same size, twice) for the worker; the folder is deleted after each file and at the end.
  • Speed (RTX 4070, measured): 45 s of audio separate in 0.6 s warm (1.3 s with the model just loaded; loading takes 0.8 s, a cold worker start about 2 s more), peak 0.76 GB VRAM, so 20 minutes of media take roughly 20 s more on the GPU. On the CPU it is far slower (not measured here; expect minutes for long files).

voices.media_cancel {"job"} -> {}: cancels the job (it ends with voices.media.error cancelled).

voices.clear_media {"id"} -> {}: deletes reference_media.wav and meta.json media; references already cut from it stay. Errors: not_found (voice), busy (a media job runs for this voice).

  • App side. The Voices card's reference section has a "Reference from media" block: a language chip (default the voice's own language; the shared language picker), a drop well with "Add media..." (native multi-file picker) and, while the job runs, "Cleaning" / "Removing background music" · File k of n · name, a progress bar and Cancel. Under the well, a "Remove background music" checkbox with the hint "Cleaner reference from videos with music; a little slower." sends remove_music true / false; it is remembered as remove_music in settings.json, and until the user sets it it is ticked when the engine reports device.backend cuda. Dropping files anywhere on the Voices screen starts the job for the active voice (the well lights up while files hover). When done: "12 files combined · 7:32 · reference set: 11.4 s from file 3", "Background music removed from 9 of 12 files." (or "Background music not removed: ." in the warning colour; nothing when it was turned off), a play button for the new reference, skipped files with reasons, and "Remove combined media". The pool's windows appear in the "Choose..." list under "From your media".

Languages

Reading texts (presets, text.analyze) and voices carry a language as an ISO 639-1 code (yue for Cantonese). Every language a speech model speaks has reading presets, 67 in all: ar as ba be bg bn bs ca cs cy da de el en es et eu fa fi fr gl he hi hr hu id is it ja ka kk km kn ko lo lt lv ml mn mr ms mt my ne nl no pa pl pt ro ru sk sl sr sv sw ta te th tl tr uk ur uz vi yue zh. Seven of them also have a phoneme inventory, so text.analyze reports their sound coverage:

Code Language Native name Reading pace (words/min) Phoneme inventory Analysis
en English English 145 39 ARPAbet phonemes (AA ... ZH) g2p_en (CMUdict + neural fallback), else NLTK CMUdict, else letter heuristic
uk Ukrainian Українська 110 38 IPA: 6 vowels, 32 consonants incl. soft dʲ tʲ zʲ sʲ tsʲ lʲ nʲ rʲ dzʲ, dz dʒ ɦ g rule-based G2P (iotation of я ю є ї, softening by ь and before і я ю є, дж/дз, -ться)
de German Deutsch 120 42 IPA: long/short vowels, ə ɐ, aɪ aʊ ɔʏ, ç x pf ts tʃ ŋ ʁ grapheme-cluster heuristic (vowel length, final devoicing, ich/ach)
fr French Français 155 34 IPA: 14 vowels incl. nasal ɛ̃ ɑ̃ ɔ̃, j w ɥ, ɲ ʁ grapheme-cluster heuristic (silent endings, nasal vowels)
es Spanish Español 140 25 IPA: 5 vowels, j w, θ x tʃ ʝ ɲ ɾ r rule-based G2P
pl Polish Polski 110 37 IPA: 6 vowels + nasal ɛ̃ ɔ̃, ɕ ʑ ʂ ʐ tɕ dʑ tʂ dʐ dz ts x ɲ w rule-based G2P (soft i spellings, rz, nasal vowels)
ro Romanian Română 135 32 IPA: 7 vowels incl. ə ɨ, j w, the semivowels e̯ o̯, final ʲ, ʃ ʒ h ts tʃ dʒ rule-based G2P (ce/ci/ge/gi, che/ghi, ea/oa, glide and final i)
  • Parameters named language accept the code in any case and with a region ("uk-UA", "en_US" -> uk, en). Anything else is bad_request (the message lists the supported codes).
  • The reading pace turns word counts into est_seconds / est_minutes. It differs per language because words differ in length (in the presets a Ukrainian or Polish word has about 2.0 syllables, a Romanian one 1.8, a German one 1.6, an English one 1.4); the figures are estimates that keep the syllable rate of every language at about 3.3-4.2 per second. Languages written without spaces (zh yue ja th lo km my) count letters instead of words, at a pace in letters per minute. A word keeps its combining marks (Indic vowel signs, Hebrew and Arabic vowel points).
  • Phoneme symbols in missing_phonemes are those of the language's inventory (ARPAbet for English, IPA otherwise).
  • The language of a voice (voices.create / voices.import language) does not change how the voice is trained; it records which presets it was read from, and it is the language where the RVC index is used at full strength (other languages are capped, see Speech model and languages). What the voice can speak is the speech model's list (hello languages).
  • App side. Record has a "Reading language" menu with search (the presets.list languages that an installed speech model speaks, remembered as record_language in settings.json); "Use my own text" offers "Detect" or one of them (text.analyze language). A new voice is made in the language that is read; an empty active voice in another language is switched to it (voices.rename language); one with recordings in another language is kept ("This is for" defaults to a new voice, named as typed or "My voice (French) #1"), or, when picked and confirmed, recorded over: the first part is saved with dataset.add start_over.

presets.list

{"language"?} -> {"language":"uk","languages":[{"code":"en","name":"English","native":"English"}, {"code":"uk","name":"Ukrainian","native":"Українська"},...],"presets":[{"id":"quick|standard|pro","title", "description","target_minutes","trains_rvc":bool,"language":"uk","parts":[{"index":1,"title","text","est_seconds"}]}]} in the order quick, standard, pro.

  • language: the language of the presets (default "en"; "auto" and null also mean "en"). languages lists every language that has presets, English first, so the app can offer a language picker. A supported code without presets, or an unsupported code, is bad_request. A missing presets folder is not_found.
  • Every language has its own texts written for it (not translated): the same three presets, the same parts and about the same reading times, so the word counts differ. title and description are UI strings (English); part title and text are in the preset's language. est_seconds uses the language's reading pace.
  • quick: about 1 minute, zero-shot only (no training), voice usable at once.
  • standard: about 6-7 minutes, trains RVC (the validated setup).
  • pro: about 15-20 minutes, best similarity.

text.analyze (user's own reading text)

{"text","language"?} -> {"language":"uk","language_detected":true,"phonemes_total":38,"words","unit":"words", "est_minutes","phoneme_coverage":0.0-1.0|null,"missing_phonemes":["dzʲ",...],"level":"too_short|zero_shot|trainable|great","message", "parts":[{"index","title","text","est_seconds"}]}

  • language: the language the text is read in. Omitted, null or "auto": detected from the text among the preset languages (the language of the text's script with the most common short words plus language-specific letters such as ї є ґ, ä ö ü ß, ą ę ł ś ż, ñ ¿ ¡, è ç œ; en when nothing points elsewhere, also for an empty text); language_detected tells whether it was detected. Unsupported code: bad_request.
  • Words of another script than the language's (e.g. Latin words in a Ukrainian text) count as words but add no phonemes; digits are read one by one in the text's language.
  • Parts are split at paragraph/sentence boundaries (also 。!?) to about 60-90 s each. Reading time is estimated from the word count at the language's reading pace. unit is "characters" for a language written without spaces: words then counts letters.
  • phoneme_coverage is the share of the language's inventory (phonemes_total phonemes) the text contains; missing_phonemes are in the inventory's order. Coverage under the language's threshold (0.80 for every language today) lowers trainable/great by one level; under 0.95 the message names up to four missing sounds with a native example word each. Every standard and pro preset covers its whole inventory (1.0). A language without an inventory has phonemes_total 0, phoneme_coverage null and no missing_phonemes; its level follows the length.

recording.check

path may be any audio or video file the shared decoder reads (see Audio formats). {"path","expected_s"?} -> {"duration_s","peak","clipping_pct","rms_db","noise_floor_db","snr_db","silence_pct", "verdict":"ok|warn|bad","issues":["Too quiet: speak closer to the mic", ...]} expected_s (the estimated reading time of the text) adds a "shorter than expected" warning below 60 percent of it. Errors: not_found (no such file), bad_request (unreadable or empty audio).

dataset.add / dataset.remove / dataset.summary

  • dataset.add {"voice_id","part_index","path","expected_s"?,"start_over"?,"language"?}: with start_over the voice first loses everything but its id, name and creation time (recordings, reference clips, media pool, trained model) and takes language; then the part is added as usual. Otherwise it reads any audio file (also the audio track of a video; so a user can import an existing file as a dataset part instead of recording), trims leading/trailing silence (0.25 s kept), normalises loudness (about -20 dBFS active speech, peak at most 0.9), stores mono 16-bit dataset/part<N>.wav (resampled to 44.1 kHz only above 48 kHz), replaces an older take of that part, refreshes reference.wav (see Reference clip: a 15-20 s window scored by SNR, speaking rate near the voice's median, few long pauses and the part's reading-text title; a manual choice is kept). The verdict is about the trimmed take. -> {"part":{"index","duration_s","verdict","issues"},"summary":{...}}. bad_request for takes under 0.3 s or below 16 kHz; not_found for an unknown voice or file.
  • dataset.remove {"voice_id","part_index"} -> {"summary":{...}} (removing a missing part is not an error).
  • dataset.summary {"voice_id"} -> {"total_minutes","usable_minutes","parts":[{"index","duration_s","verdict","issues"}], "level":"too_short|zero_shot|trainable|great","message","recommended_epochs","has_reference","reference"?}
    • usable_minutes counts only parts whose verdict is not bad; level is computed from it (under 0.5 min too_short, under 3 zero_shot, under 10 trainable, else great).
    • recommended_epochs is 0 below 3 usable minutes (not trainable), otherwise exactly what train.start with epochs: null would use (300 * sqrt(6.4 / minutes) clamped to 150..450, rounded to 10).
    • has_reference: reference.wav exists. reference (present only then): {"part","start_s","end_s","duration_s"}, the clip cut from that part (plus "manual":true after voices.set_reference, "rate" and "pauses" when known). A clip from the media pool is {"source":"media","start_s","end_s","duration_s","manual":true,"pool","file","title",...} (no part). After voices.import with a reference_path it can describe an older choice.
    • Parts copied into dataset/ by hand are analysed on the first summary.

train.start / train.pause / train.resume / train.cancel

train.start {"voice_id","epochs":null,"restart"?:false} (null = auto: recommended_epochs of the dataset minutes; an integer 1..2000 otherwise) -> {"job"}; train.cancel {"job"} -> {}. train.pause, train.resume and the paused-run forms of train.start / train.cancel are described in Pause and resume.

  • Needs the voice to have at least 1 minute of recorded dataset. A new training starts from scratch and replaces rvc/model.pth / model.index only when it finishes. Errors at start: bad_request (epochs out of range, no or too little dataset), not_found, not_ready (Applio runtime missing, or the speech models are still loading), busy (a training is running, or a generation is running: wait for it or tts.cancel it first), paused (this voice has a paused or interrupted training and restart is not true).
  • GPU hand-over. The training runs inside tts.gpu_released: when train.start answers, the OmniVoice worker and the RVC worker are stopped, so both models entries are loading (a models event is sent) and tts.generate / voices.warm answer not_ready for the whole training. When the job ends (train.done, train.error, a cancel or a pause) the models reload in the background (about 20-30 s, models events, ready again), and the new RVC model is read from disk by the fresh worker.
  • Events: train.progress {"stage":"preprocess|extract|train|index","epoch","total_epochs","pct":0-100,"eta_s"} about every 0.5 s and at each stage change; train.done {"voice_id","epochs","elapsed_s"}; train.error {"code","message"} with cancelled or internal (out of memory is reported in plain words); train.paused (see below).
    • pct is overall (preprocess 0-5, extract 5-15, train 15-95, index 95-100). epoch is 0 outside train/index and 1-based while training. total_epochs is the planned count.
    • eta_s is null until three epoch ends have been measured and always null outside the train stage; afterwards it is the mean of the recent epoch times times the remaining epochs, plus 20 s for export and index.
  • On success voice.json gets "trained":true, "trained_epochs" (the epochs actually done) and "trained_at" (local time, YYYY-MM-DDTHH:MM:SS), which voices.list reports. The full Applio output is kept in <data>/tmp/train_<voice_id>.log until the next engine start.

Pause and resume

How it works: Applio resumes by itself when core.py train is started again on the same model folder (<applio>/logs/mimvox_<voice id>/): it loads the newest G_*.pth / D_*.pth pair, reads the finished epoch stored in it and continues with the next one. The engine therefore asks Applio for one checkpoint pair every 5 epochs (about 1.3 GB written per save at 40 kHz, HiFi-GAN) and keeps only the newest pair. It does not use Applio's --save-only-latest (one file overwritten in place: a kill during the save would destroy the only checkpoint); Applio writes G_<step>.pth/D_<step>.pth and the engine deletes the older pair once the next epoch is running, i.e. once the save is known to be complete. A checkpoint is only trusted when both files are complete zip archives; a torn newer pair is removed so that Applio picks the older valid one. At most 4 epochs of work are lost.

  • train.pause {"job"} -> {"pausing":true} at once. Only while the job is in the train stage (not_ready before that: preprocessing and feature extraction cannot be paused; not_found for an unknown or finished job). The engine waits until a checkpoint is safely on disk: it stops immediately when the newest checkpoint is the current epoch, otherwise after the next checkpoint save (at most 5 epochs; after 90 s without one it stops and accepts the loss). If the training is in its last epoch it just finishes (train.done arrives instead of train.paused). Then the Applio process tree is stopped, Applio's folder is kept, voice.json gets "training_paused":{"epoch","total_epochs","model_name","paused_at",...}, and the event train.paused {"voice_id","epoch","total_epochs","paused_at","reached_epoch"} (job = the training job) ends the job. epoch is the epoch of the saved checkpoint (where a resume continues), reached_epoch how far the training had got. The speech models are reloaded at once (the GPU hand-over is closed like after train.done: models events, ready again after about 50 s), so Speak and Redub work while paused.
  • train.resume {"voice_id"} -> {"job"}. Hands the GPU over again (same busy / not_ready rules as train.start; the models must be ready, so the app enables Resume only then), skips preprocess and extract (the features are in Applio's folder; if the folder is missing or incomplete the full pipeline runs again from epoch 1), repairs the checkpoints, and starts core.py train with the same total epochs, batch size and cache setting. train.progress continues from the saved epoch: the first event is stage:"train" with epoch = the saved epoch and the pct that epoch had before; eta_s is null for the first three epochs. Afterwards the index is built and the model copied as usual and training_paused is cleared (train.done). Errors: not_found, bad_request (no paused run, or the recordings changed since the pause: discard it and train again), not_ready, busy.
  • train.start {"voice_id","restart":true} on a voice with a paused run discards it (Applio folder and flag) and starts from scratch; without restart it answers paused ("A training of this voice is paused at epoch k of N. Resume it, or discard it to start over.").
  • train.cancel {"voice_id"} (instead of {"job"}) discards a paused run: deletes the Applio folder and clears training_paused -> {}. busy when that voice is training right now. Cancelling a running job always discards its checkpoints, too. voices.delete removes the Applio folder as well.
  • Interrupted runs. While a training runs, voice.json holds an internal "training_run":{...} marker (model name, total epochs, batch size, newest confirmed checkpoint epoch / step, steps per epoch). If the engine goes away without a pause (app closed with "Close anyway", crash, killed process), the next engine start finds the marker before it answers ready, stops Applio workers that survived (the PIDs are in Applio's config.json), repairs the checkpoints and, when a valid one exists, turns the run into "training_paused":{...,"interrupted":true} with the epoch of the newest checkpoint (at most 4 epochs lost); voices.list then shows it and train.resume works as after a pause. Applio folders are never cleaned at engine start (only <data>/tmp is). A run that fails while learning (for example out of memory) keeps its latest checkpoint the same way (train.error message says "Progress up to epoch k was kept"), and a graceful engine shutdown stops a running Applio.
  • App side (not part of the wire protocol). Closing the window while a training runs shows a dialog (Rune cannot veto a close, so the window hides and is reopened at once): "Pause and close" sends train.pause and quits on train.paused; "Keep training" dismisses it; "Close anyway" shuts the engine down (the engine stops Applio) and quits, and the run is found again as an interrupted one at the next start. The Train tab shows pause k/N while a run is paused, the Voices card "Paused k/N" (or "Interrupted k/N").
  • voice.json keys written by training: training_run (internal, only while running), training_paused (epoch,total_epochs,model_name,paused_at,interrupted? plus internals steps_per_epoch,checkpoint_step,batch_size, cache_in_gpu,dataset_sig).

tts.generate / tts.cancel

{"voice_id","text","expressiveness":0.8,"voice_match":1.0,"quality":"best","speed":1.0,"language"?:"en", "output_format"?:"wav","model"?:"auto"} -> {"job","segments":3,"segment_chars":[64,150,92],"model":"omnivoice"}; tts.cancel {"job"} -> {}

  • model: which voice-cloning model speaks, see Other voice-cloning models. The settings below are OmniVoice's; that section says what they mean for the others.
  • expressiveness (0.1-1.5, default 0.8) maps to OmniVoice's sampling: position_temperature = 5.0 * e / 0.8 (how freely the order of the unmasked tokens, i.e. phrasing and pauses, varies; 5.0 is the model default) and class_temperature = max(0, e - 0.8) (token sampling; 0 = greedy, the default). 0.8 gives the model's defaults, lower is flatter and steadier, higher varies more. voice_match (0-1, default 1.0) is the RVC index rate in the language the voice was recorded in (voice.json language, default en) and is capped at 0.3 in any other language (see Speech model and languages); it is ignored when the voice has no RVC model (zero-shot output is returned as is), 0 skips RVC. Out-of-range numbers are clamped, non-numbers are bad_request.
  • speed (0.8-1.3, default 1.0, clamped like the other numbers): speaking speed, OmniVoice's speed control (the model sizes the speech to 1 / speed of its natural length; pitch unchanged, RVC afterwards as usual). Every segment uses the same value. The tempo copied from reference.wav is the baseline, so speed is relative to that clip (see voices.reference_candidates).
  • quality: best (default, 32 OmniVoice decoding steps) or fast (16 steps, about twice as fast per segment, slightly less clean). With the zero-shot converter of the native accent it also sets its diffusion steps (12 / 8). The first segment always uses 16 steps for a quicker first sound.
  • language (optional, default "en"): the language of text, an ISO 639-1 code from the list in Speech model and languages; another code is bad_request. It selects OmniVoice's language and the text normalization (numbers, units, abbreviations spelled out in that language). App side: the Speak "Style" panel has a language chip (searchable picker, "Common" then "All languages"); the default is the active voice's language, a different choice is remembered per voice in settings.json (speak_languages: {voice_id: code}); a language the voice was not recorded in shows a hint and "Record a reference".
  • output_format (optional, default "wav", so older clients keep getting WAV): the format the finished result is saved in, one of wav mp3 flac ogg opus m4a aiff (as audio.export, see Saved results).
  • Errors: bad_request (empty text, bad quality, unknown language or output_format), not_found (voice, or it has no reference.wav), not_ready (models loading, missing, or handed over to training; or output_format cannot be written on this machine), busy (another generation is running; only one at a time).
  • The text is cut into segments pieces: paragraphs are never merged, the first segment is the first sentence only (so audio starts fast), later ones are packed up to about 2.5 times the previous size (at most 70 tokens), and a paragraph never ends in a tiny segment. segment_chars lets a client estimate the remaining speech per segment.
  • Defaults: OmniVoice fp16, 32 steps (16 for fast and segment 0), guidance scale 2.0, reference cut to 7-12 s of whole sentences; RVC rmvpe, protect 0.33, pitch 0.
  • Events, in order: tts.chunk {"index","path","duration_s","segments","ready_s","rtf"} (one per segment, final audio at 44.1 kHz, already includes the pause after it, play at once), then tts.done {"path","path_play","format", "duration_s","elapsed_s"} (see Saved results), or tts.error {"code","message"} (cancelled after tts.cancel; no_memory when the RAM is too small or full, see RAM on the CPU; the slot is free again when the event arrives). ready_s is the wall time from the start of the job to this chunk; rtf is the wall time since the previous chunk (or the start) divided by this chunk's speech seconds, so rtf < 1 means generation is faster than playback. Chunk files live in <data>/tmp/<job>/ and are deleted after an hour.

Saved results (output_format)

tts.generate, redub.dub and redub.render save each finished result as one file in <data>/outputs: <YYYYMMDD_HHMMSS>.<ext> (Speak) or redub_<YYYYMMDD_HHMMSS>.<ext> (Redub), <ext> being the request's output_format (wav default, mp3, flac, ogg, opus, m4a, aiff; aif/oga/wave aliases as in audio.export). A name already taken in outputs with that extension, or by a playback WAV, gets _2, _3, ....

  • wav is written directly (16-bit PCM, 44.1 kHz mono). Every other format is encoded from a 16-bit 44.1 kHz playback WAV written first to <data>/tmp/play/<same name>.wav, with the audio.export encoders at quality high (MP3 320 kbps, Ogg Vorbis q7, Opus 128 kbps at 48 kHz, AAC 256 kbps; FLAC/AIFF lossless); without ffmpeg libsndfile writes wav, mp3, flac, ogg and aiff. MP3 cannot store RVC's 40 kHz: the track is always 44.1 kHz by then.
  • The end event carries "path" (the saved file: show it, open it, export it), "path_play" (a WAV of the same audio: path itself for wav, else the playback WAV in tmp/play, which is deleted at the next engine start) and "format" (the format actually saved). Should the encoder fail after the audio was made, the result is kept as <name>.wav in outputs ("format":"wav", logged) rather than lost.
  • The format is checked when the job starts: an unknown name is bad_request, one this machine cannot write (no ffmpeg, or a build without the encoder; see formats.list export) is not_ready.
  • App side: the Results headers of Speak and Redub have a "Save as WAV" chip (one setting for both, output_format in settings.json, default wav); it lists the formats of formats.list export. The app plays path_play, and "Show in folder", "Open file" and "Export as..." use path (an export encodes from path_play while it exists). Fields path_wav / path_mp3 of earlier versions are gone.
  • Sidecar. Next to every saved result the engine writes <same stem>.result.json (atomically: a temporary file, then a rename; a failure is logged and the result kept), so the result comes back after a restart (outputs.list): {"version":1,"created":<unix s>,"kind":"speak|redub","voice_id","voice_name","language","accent","duration_s", "elapsed_s","format","path","video_path"} plus, for Speak, "text" (the whole text), and for Redub "mode" (dub | convert | respeak | subtitles; a redub.render with "result_mode":"dub" records dub), "source_name" (the source file's name), "to" (the language spoken: a dub's target, a respeak's text language) and "language" (a dub: the detected source language; a respeak or subtitles: the text language; a convert: null). A subtitles result has no voice: no voice_id, voice_name, accent or to. Speak, dub, respeak and subtitles results also record "segments":[{"start","end","text"}, ...]: where each spoken piece sits in the saved file, in seconds rounded to 3 decimals (Speak: each synthesized segment, the pause after it excluded; dub / respeak: each clip as placed in the final track, its spoken text; subtitles: the lines given, at their times in the source). A convert has no text and no segments, nor has a sidecar written before the field existed. outputs.list does not return them. path / video_path are the absolute paths at save time; outputs.list uses the files found next to the sidecar, so a moved data folder still works. outputs.delete deletes the sidecar with its result.
  • Pre-buffer rule (client). Chunk 0 is played as soon as it arrives and later chunks are queued gaplessly behind it; the segment growth schedule keeps rtf of the later chunks near 1 (measured 1.05-1.4). A client that wants to avoid underruns on slower hardware estimates the total speech S = duration_s(chunk 0) * sum(segment_chars) / segment_chars[0] and holds chunk 0 back for max(0, rtf * (S - duration_s(chunk 0)) - S) seconds, taking rtf from chunk 0 (a first estimate) and refining it with each new chunk. With rtf <= 1 this is 0: start at once.

outputs.list (the saved results, after a restart too)

{"kind"?:"speak|redub","limit"?:50,"before"?:<unix s>} -> {"results":[<entry>, ...],"more":false}

  • The results in <data>/outputs (top level only: books/ and other folders are skipped), newest first by created, at most limit (default 50, at most 500; not a positive integer is bad_request), only those of kind when given, only those with created < before when given (the next page: before = the last entry's created). more says older ones exist.
  • One entry per result: the files with one stem are one entry (redub_<stamp>.mp3 + redub_<stamp>.mp4 + its sidecar). {"id":"<stem>","kind","legacy":false,"name":"<saved file name>","created","path","path_play", "video_path","duration_s","elapsed_s","format"} plus the sidecar's voice_id, voice_name, text, language, accent, mode, source_name, to when it has them.
  • A result saved before sidecars (legacy: true) is recognised by its name only: <YYYYMMDD_HHMMSS>[_N] is Speak, redub_<YYYYMMDD_HHMMSS>[_N] is Redub. Any other audio or video file without a sidecar was put there from outside and is listed the same way with external: true (legacy true too): audio as speak, a video without audio of the same stem as redub; <stem>_export.<ext> next to a result <stem> is an export of it (audio.export's default name) and is skipped. The app's refresh button asks again, so files added or removed on disk show at once. Such an entry gets name, created (the file's mtime), duration_s (read from the file: libsndfile, else ffprobe; cached for the session by path, mtime and size) and format; elapsed_s and the sidecar fields are null / absent. A sidecar whose files are gone is skipped.
  • path is the audio file (a video-only result: the video); path_play is a WAV that plays it now without decoding (path itself for a WAV, or this session's copy in tmp/play), else null: then ask outputs.play.
  • App side: once the engine is ready Speak and Redub each ask for their kind (limit 50) and fill their Results panels; results finished this session go on top. "Show older" at the bottom (shown while more) asks with before. A legacy entry shows its file name as the title (and, on Redub, "Redubbed" for its unknown mode). After an engine restart the list is asked again and merged by file name.

outputs.play (a WAV to play a saved result)

{"path":"<absolute path>"} -> {"path","path_play"}

  • Like book.play for a Speak / Redub result: path_play is path itself for a WAV, else a decoded copy (16-bit, 44.1 kHz, the file's channels) in <data>/tmp/play/<stem>.wav, made once and reused for the rest of the session (tmp is emptied at every engine start). A video path plays its first audio track.
  • path must be absolute and inside <data>/outputs (resolved through symlinks) else bad_request; a missing file is not_found; an undecodable one bad_request / internal.
  • App side: the play button of a take and Redub's "Result" ask for it when their play path is not a WAV on disk (a result from an earlier session, or after an engine restart), then play the answer and keep it for the card.

outputs.delete (delete a saved result)

{"path":"<absolute path>","path_play"?:"<absolute path>"} -> {"deleted":["<absolute path>", ...]}

  • Deletes a saved result: path (the path of a tts.done / redub.done) and, when given, path_play (its playback WAV; omit it, or send the same path, for a wav result). Only regular files inside <data>/outputs or <data>/tmp/play can be deleted: every path is resolved first (symlinks and .. included) and checked before anything is removed, so one path outside those folders, a relative path or a folder refuses the whole request with bad_request and deletes nothing.
  • Files in <data>/outputs with the same name as path and another extension go too: they belong to the same result (a Redub of a video saves redub_<stamp>.<audio ext> and redub_<stamp>.<video ext> side by side), and so does its sidecar <stamp>.result.json.
  • A file that is already gone is not an error (it is simply not listed in deleted). A file that cannot be removed (permissions, held open by another program on Windows) is internal with the reason.
  • App side: the trash button on a Speak take card and on a Redub Results row asks "Delete this result?" inline, stops the result if it is playing, sends this request and drops the entry from the list when the answer arrives (an error leaves it and shows a toast).

Ukrainian with exact stress (HolosTTS)

With the optional ukrainian component installed and loaded, every Ukrainian segment (language: "uk" in tts.generate, Book, Redub's dub and re-speak) is spoken by HolosTTS (patriotyk, MIT) instead of OmniVoice, in a worker process with the interpreter of its own environment (backends/holos_worker.py, ops load, synth, warm, stress, release, status). It reads IPA phonemes that carry the stress, so the stress the text front-end chooses is the one that is spoken:

  • the user's marks (+ right before a vowel, or U+0301 / ´ after it) win over everything else;
  • numbers, units, dates and abbreviations are spelled out by the same Ukrainian rules as OmniVoice's (backends/omnivoice_text.py);
  • every other word gets its stress from lang-uk's dictionary, with Stanza's Ukrainian part-of-speech and morphology tags choosing between the readings of a heteronym (patriotyk's ukrainian-word-stress), and from a small neural accentor when the dictionary lacks the word; then ipa-uk makes the phonemes.

The voice comes from the voice's reference clip (reference_uk.wav when it exists) through HolosTTS's voice encoder; the clip's language does not matter (only timbre and manner are taken, never the accent). expressiveness and quality do not apply to it (no sampling, no decoding steps); speed does. RVC, pauses and slot fitting are as for OmniVoice. Measured on an RTX 4070: about 0.1 s per second of speech (10x OmniVoice), 2.3 GB of VRAM.

  • Timbre. HolosTTS's voice encoder keeps little of a voice: speaker similarity to the reference clip (ECAPA) was 0.76, against 0.94 for OmniVoice from the same clip. A trained voice goes through RVC as always; a voice that is not trained is used as HolosTTS made it (the zero-shot converter made the Ukrainian "р" burr, so it is not used here).
  • exact_stress (tts.generate, book.start; default true): false speaks Ukrainian with OmniVoice even when HolosTTS is installed. A book keeps the value it started with.

When the component is not installed, failed to load or is paused for a training, Ukrainian goes to OmniVoice as before (backends.for_language skips a backend that is not available()). The tts entry of models is OmniVoice's while it is installed, else that of the other voice-cloning models (ready once one of them is installed).

Other voice-cloning models (VoxCPM2, Chatterbox)

The optional voxcpm (VoxCPM2, OpenBMB, Apache-2.0) and chatterbox (Chatterbox Multilingual, Resemble AI, MIT) components are voice-cloning models beside OmniVoice, which is optional as well. Each runs in a worker process with the interpreter of its own environment (backends/voxcpm_worker.py, backends/chatterbox_worker.py, sharing backends/clone_worker.py; ops load, synth, release, status).

  • model (tts.generate, book.start; default "auto"): "auto" is the first installed model that speaks the language, OmniVoice first (HolosTTS for Ukrainian with exact_stress, for "omnivoice" too); "omnivoice", "voxcpm" or "chatterbox" names one. A named model that is not installed is not_ready, one that does not speak language is bad_request, any other value is bad_request. A book keeps the value it started with. The reply of tts.generate and tts.done say which model spoke (model). Redub always speaks with "auto".
  • Languages. VoxCPM2: ar da de el en es fi fr he hi id it ja km ko lo ms my nl no pl pt ru sv sw th tl tr vi zh. Chatterbox: ar da de el en es fi fr he hi it ja ko ms nl no pl pt ru sv sw tr zh.
  • Loading. A model loads on its first use (the models event does not cover it), and only one of the two is loaded at a time: the other's worker ends first. When the card is still short of memory after the idle workers released their models (no_vram), the idle worker processes end too and the request is tried once more; they start again on their next request. A model that still does not fit runs on the processor until the engine restarts (a 4 GB GTX 1650: Chatterbox about 90 s for a sentence). A card of 6 GB or less keeps 0.5 GB of VRAM free instead of 1.5 GB (MIMVOX_VRAM_RESERVE_GB sets it). On a 12 GB card a switch between models costs 10-20 s.
  • Reference. The worker clones from the clip (reference_<lang>.wav when it exists). VoxCPM2 clones best from the clip together with what it says: it uses the stretch of the clip Whisper transcribed (its .omnivoice.json), and asks the OmniVoice worker to transcribe the clip first when there is no transcript yet (Whisper only: the worker runs without the OmniVoice weights, and hosts Seed-VC either way). With accent: "native-us" it speaks from the native clip and its transcript, and the converter gives it the user's timbre as for OmniVoice.
  • Controls. Neither model has a speed control: the engine stretches the result to speed with ffmpeg (pitch kept). quality is VoxCPM2's diffusion steps (10 Best, 6 Fast); expressiveness is Chatterbox's exaggeration (0.8 -> its default 0.5, at most 1.0). Numbers and symbols are spelled out as for OmniVoice. Chatterbox's speech is at most about 0.12 s per character plus 0.8 s: on a word or two it otherwise went on babbling.
  • Measured (RTX 4070, the same 9.8 s English clip; ECAPA speaker similarity to held-out audio of the speaker, Whisper WER): OmniVoice 0.72-0.76 in English, RTF 0.09, 4.8 GB; VoxCPM2 0.73-0.75, de/pl 0.65-0.69, RTF 0.66, 5.7 GB; Chatterbox 0.74-0.80 in English, 0.72 de, 0.46 pl, RTF 0.25, 3.0 GB. WER was 0 for nearly every sentence. Chatterbox's output carries Resemble AI's inaudible Perth watermark.
  • Chatterbox's decoding loop. On CUDA its language model runs in fp16 (the same speech tokens as fp32 on every test sentence) through backends/chatterbox_fast.py: a static KV cache, SDPA attention and one CUDA-graph replay per token, over the smallest of a few cache lengths that holds the tokens so far. The library's own loop turns every layer to eager attention to read the three heads its alignment check uses (15.6 ms per token); here those heads are computed on their own (4-5 ms per token), and the check, the sampling and the stops are the library's. A prompt that does not fit 2048 positions takes the library's loop (in fp32).

text.stress

{"text"} -> {"stressed","unsure":[...]}: the text as HolosTTS would speak it, U+0301 after each stressed vowel (numbers and abbreviations spelled out), and the words of two or more syllables that got no stress. not_ready when the ukrainian component is not installed or not loaded; bad_request for an empty text or more than 200,000 characters.

Speech model and languages (OmniVoice)

Every segment (but Ukrainian with the ukrainian component, above) is spoken by OmniVoice (k2-fsa, 0.6B, CC BY-NC 4.0 weights), run by a persistent worker process with the engine's interpreter (backends/omnivoice_worker.py, wire format worker_kit.py, ops load, synth, warm, release, status, inspect). Its state is the tts entry of the models event. IndexTTS-2.5 is no longer used. The rest of the pipeline (RVC, resampling, pauses, slot fitting, events) does not depend on the model (backends/__init__.py).

Languages (language of tts.generate, Redub's language guard; ISO 639-1, every language with at least ~100 h of OmniVoice training data): en zh ja es fr de ru pt yue th it ko vi id no ca hr lt sk sv el nl bg sr uk be da kk lv sl ar et pl bs is mt eu fi ta sw fa bn as mn hu ba te ur gl ml ka mr cs pa cy kn tr hi uz ne.

  • Text: before synthesis the worker spells out numbers, symbols and common abbreviations (backends/omnivoice_text.py): for Ukrainian with case after prepositions and agreement of units (у 2026 році -> у дві тисячі двадцять шостому році, 5 травня -> п'ятого травня, 15% -> п'ятнадцять відсотків, 3,5 години -> три з половиною години, 1 250 грн, т.д., вул., о 10:30), for English years, ordinals, money, time and decimals, for other languages integers and decimals through num2words. The text is NFC-composed first.

  • Word stress (backends/omnivoice_stress.py): OmniVoice follows an upper-case stressed vowel (співакОм); a combining acute (U+0301) after the vowel works except on a stressed last syllable, where it pulls the stress one syllable earlier, and + is sometimes read aloud. So in uk, ru and be text the user's marks (+ right before a vowel, or U+0301 / ´ after it) become an upper-case vowel (співак+ом -> співакОм); a stressed word-initial vowel keeps the acute (+атлас -> а́тлас), a word in capitals loses the mark, and ´ after a consonant is a typed apostrophe and becomes '. In other languages the marks are removed (a grave U+0300 everywhere). Automatic stress from lang-uk's dictionary (ukrainian-word-stress in dictionary-only mode with marisa-trie, installed by setup, offline) is off by default: MIMVOX_STRESS_AUTO=last marks unmarked Ukrainian words stressed on their last syllable, all every word with two or more vowels; heteronyms, unknown words and words that already have a mark or an inner capital are skipped. Off because it did not improve whole test sentences.

  • Reference: reference.wav used whole up to 12 s, longer clips are cut to 7-12 s of whole sentences (statements preferred over questions; Whisper turbo finds the sentences once per clip, cached in reference.omnivoice.json with the detected language, see Reference language). reference_<lang>.wav, when present, is used for that language instead: OmniVoice carries the accent of the reference into the target language.

  • RVC in other languages: the voice's RVC index only holds sounds of the language it was recorded in (voice.json language, default en). For speech in another language the index rate is min(voice_match, 0.3) (rvc.index_rate_for; tts.generate, Redub respeak and dub); index 1.0 garbled Ukrainian words (Whisper WER 25 % instead of 6 %), 0.3 keeps them and most of the timbre. MIMVOX_RVC_FOREIGN_INDEX overrides the 0.3.

  • Training hand-over: the worker process is ended (all its VRAM and RAM back) and started again after the training.

  • Time limits: on a GPU a synth, warm or inspect call has 300 s, a first transcription of the reference and a cold load included. On the CPU (backend = "cpu", or no usable GPU at load) it has no fixed limit: the worker sends progress at most every 2 s while a model runs (OmniVoice, its audio tokenizer, Whisper), and only 600 s without one end the call. A short segment takes minutes there (see performance).

  • RAM on the CPU: every decoding step reads all the fp32 weights, so the worker does not trim its working set after loading or after Whisper as it does on a GPU (there those pages only carried the weights to the card). The weights are about 3 GB, but the worker holds more (measured on Windows): 5.0 GB of private memory after loading, 6.4 GB after a segment and 7.45 GB while Whisper (fp32, about 3.8 GB) transcribes a new reference (Linux: 7.1 GB in RAM at that peak). Speech on the CPU therefore needs a computer with 12 GB of RAM or more. Before every model pass on the CPU (load, warm, synth and inspect before they load anything, the reference transcription, the voice-clone prompt and each segment's decoding) the worker checks the RAM, the same way each time:

    • less than 11 GB of RAM in all (the worker plus about 3.5 GB for the system, the engine and the app; MIMVOX_CPU_RAM_NEED_GB changes it): no_memory with "not enough memory (RAM) for speech on the processor: it needs a computer with at least 11 GB of RAM and this one has 7.4 GB, ...". This does not depend on what else runs, so every request on such a computer gets the same answer at once instead of swapping for minutes. The engine makes the same check at start-up when backend = "cpu", before it starts the worker, and the worker's load makes it when no GPU turned out to be usable: either way nothing is loaded and models reports tts: no_memory with this message as tts_message.
    • the available physical memory below 5 % of it (at least 0.5 GB) and at least 1 GB of the weights not in RAM (one page in 16 sampled; Windows: not in the working set, so compressed or in the page file; Linux: mincore): no_memory with "not enough free memory (RAM): the speech model needs more RAM than is free on this computer (...); close other programs or use a computer with more RAM".
    • before the first voice-clone prompt after a load, which grew the worker by about 3.2 GB (MIMVOX_CPU_PROMPT_GB): the available physical memory less than that above the same low mark: no_memory with "not enough free memory (RAM): the speech model needs about 3.2 GB more to take on a voice ...; close other programs or use a computer with more RAM".

    Most of that memory is the worker's own, so a refusal with the model loaded also releases it (and its voice-clone prompts); the next request loads it again.

    The worker's error line for the first one carries "permanent": true, as waiting cannot help there: a Book ends at once with book.error no_memory and that message. After the other two a Book shows stage: "memory" and retries. tts.generate ends with tts.error no_memory and the message in both cases. On a GPU or MPS neither check runs.

Native accent (accent)

OmniVoice carries the accent of the reference clip into the target language, and voice conversion keeps the pronunciation it is given. accent: "native-us" makes English come out with a native American accent in the user's timbre: OmniVoice speaks from a shipped native reference instead of the voice's clip, then a voice converter gives the result the user's timbre (accent.py): the voice's RVC model when it is trained, else the zero-shot converter (Seed-VC, zsvc.py), which takes the timbre from the voice's reference.wav with no training.

  • Parameters (optional) of tts.generate, redub.dub and redub.render (respeak only; ignored by convert): "accent": "own" | "native-us" (default own: the voice's own reference, as before) and "native_voice": "auto" | "male" | "female" (default auto). Other values are bad_request.
  • When it applies: the speech is English (language of tts.generate, target_language of redub.dub, the spoken language of a respeak). The converter is the zero-shot converter whenever setup installed it (hello -> zero_shot_vc), for trained voices too (RVC, trained on a few minutes of the user, turned another speaker's audio metallic); without it, RVC for a trained voice (rvc/model.pth) with voice_match > 0. Otherwise the request is not refused: it speaks with the voice's own reference and says why (see below). It works for a voice of any recording language (the app offers it when the voice has no English clip, see App side).
  • Native references: engine/src/mimvox_engine/assets/native/ (shipped inside the engine package, so every install has them): en-us-male.wav (CMU ARCTIC bdl) and en-us-female.wav (slt), US English, about 11.5 s, mono 24 kHz; en-us-<gender>.txt is the transcript (sent to the worker as ref_text, so no Whisper pass and no .omnivoice.json sidecar: the folder may be read-only); voices.json lists them with their median F0 (116.6 and 182.9 Hz); the licence is CMU_ARCTIC_COPYING.txt next to them. Rebuilt by tools/release/make_native_refs.py.
  • Speaker: auto picks the native speaker whose median F0 is closest on a log scale to the median F0 of the voice's reference.wav (pYIN 60-500 Hz over at most 30 s, measured once per clip state per engine run, a few seconds of CPU; unknown pitch: male). male / female force one.
  • RVC (trained voice): pitch = round(12 * log2(voice F0 / native F0)) semitones (within +-12; 0 when the voice's pitch is unknown), so the timbre model gets a pitch in the user's own range; index rate min(voice_match, 0.2) (MIMVOX_RVC_NATIVE_INDEX overrides 0.2): the retrieval index holds the user's own phoneme features, and a high rate pulls the native vowels back towards the user's accent; the timbre comes mostly from the model itself. RVC worker convert takes "pitch" (int semitones, default 0).
  • Zero-shot converter (untrained voice): Seed-VC v1 (DiT with a Whisper-small content encoder, CAM++ speaker style, BigVGAN 22.05 kHz), CFG 0.7, the voice's reference.wav as the target (its first 20 s). Diffusion steps follow the job's quality: 12 for best, 8 for fast (zsvc.STEPS; 25 before: 12 gave the same held-out speaker similarity and Whisper WER at half the conversion time, see docs/performance.md, "Zero-shot native accent"). It generates the reference's pitch itself, so no transpose (pitch 0); voice_match does not apply. Each segment is converted as it is produced, like RVC (streaming unchanged). Worker zsvc_worker.py, run with the engine interpreter (python -I zsvc_worker.py --seed-vc <dir> --models <dir> --device cuda|cpu|mps; wire format worker_kit.py): ops load {} -> {"load_s","device","vram_gb"}, convert {"in","out","ref","steps"?:12, "cfg"?:0.7} -> {"elapsed","duration_s","sr"} (out a 22.05 kHz mono WAV of the input's length; the reference prompt is cached per clip state, 2 clips), warm {"ref"} -> {"elapsed_s"} (also runs one short throw-away conversion the first time after a load, so the first real segment does not pay for the first DiT and vocoder run), release {} -> {}, status {} -> {"loaded","vram_gb"}; event {"event":"unloaded","reason":"idle"} after 10 idle minutes (MIMVOX_ZSVC_UNLOAD_S). About 1.6 GB of VRAM; on an RTX 4070 a 4.5 s segment converts in about 0.5 s at 12 steps alone, about 1.25 s while OmniVoice synthesizes the next one (docs/performance.md). GPU hand-over: on a GPU with less than 10 GB (hello device.vram_gb) OmniVoice and the converter take turns (one shared lock around each synthesis and each conversion) instead of overlapping; a training stops the worker with the others (release_gpu), and speech.yield_gpu still runs before the job.
  • Results: the tts.generate answer, the redub.dub answer (review:false) and the redub.render answer (respeak) carry "accent" (what the job does: own | native-us); with native-us also "accent_converter": rvc | zero-shot. tts.done and redub.done carry them too, plus "native_voice" (male | female) and "pitch" (the RVC transpose; 0 with the zero-shot converter) when it is native-us. When native-us was asked but cannot be used they add "accent_fallback": not_english, no_converter (an untrained voice, or voice_match 0, and the zero-shot converter is not installed) or unavailable (the native clips are missing), and "accent_note", a sentence for the user. (untrained and voice_match_off of earlier versions are now no_converter, or no fallback at all with the converter installed.) A redub.dub with review:true speaks nothing: send accent again with the redub.render that finishes it.
  • Warm-up: voices.warm {"id","accent"?:"native-us","native_voice"?} also measures the voice's pitch and builds the native clip's voice-clone prompt, and for a voice that uses the zero-shot converter it starts the converter and builds the prompt of reference.wav (all included in the voice.warm it ends with; already_warm only when that is done too). The OmniVoice worker keeps the voice-clone prompts of the last 3 clips (--prompt-cache, least recently used out), so the user's reference and the native clips stay warm side by side and switching between own and native-us rebuilds nothing.
  • App side: Speak's Style panel shows "Accent" (Native (American) | Like my recordings, with Speaker Auto | Male | Female under Native) when the output language is English and the voice has no English clip: no reference_en.wav, and reference.wav is not English (its detected reference_language, or while that is null the voice's language; see Reference language). Redub shows the same in Translate & dub when "To" is English (sent with redub.dub and with the redub.render of a reviewed dub) and in Re-speak when the text is English (the transcript's language, the "Translate the transcript" target, or the spoken language; sent with its redub.render). Native is the default; the choice is remembered in settings.json (accent: native-us | own, native_voice) only once the user changes it. A trained voice says "A native American speaker says it; your trained voice model keeps your timbre."; an untrained one, with zero_shot_vc, "Native accent from your reference clip (no training needed); training makes it closer to you.". An untrained voice without zero_shot_vc shows the choice disabled, with "Run setup to install the zero-shot voice converter, or train this voice, ..." and an "Add an English clip" button that opens Voices with the Other languages panel set to English; with "Like my recordings" the button is there too. voices.warm is sent with the accent whenever Native is possible and chosen for a voice without an English clip. An accent_note is shown as a warning toast.

Reference language

OmniVoice copies the accent of the clip it clones, so the language actually spoken in a voice's reference clip decides the accent of its speech in every other language. The engine reads it from the clip, never from voice.json language (reflang.py):

  • Per-language clips reference_<lang>.wav are in <lang> by their name.
  • reference.wav: the OmniVoice worker transcribes a clip once per clip state (with Whisper turbo, language not forced) and stores Whisper's detected language in the sidecar reference.omnivoice.json ("language"), next to the transcript. A sidecar that does not match the clip's current mtime and size counts as missing.
  • Fallback for sidecars written before the field existed: a script heuristic on the stored transcript. Cyrillic is Ukrainian when it has і ї є ґ, Russian with ы э ъ ё (the larger count wins), Belarusian with ў, Serbian with ђ ј љ њ ћ џ, Kazakh with its own letters, otherwise unknown; Greek, Hebrew, Arabic, Devanagari, Hangul, kana, Han, Thai and Georgian by script; Latin text by counting very frequent words of en de fr es it pt pl ro cs nl (at least two hits and a single winner, else unknown).
  • Unknown (null) while no current sidecar exists. Whisper never runs in the engine process: the sidecar is built by the worker on the next voices.warm or generation from that clip. voices.warm also asks the worker to inspect the clip when the language is still unknown afterwards (worker op inspect {"ref","detect"?:true} -> {"language","text","elapsed_s"}: builds the sidecar with Whisper only, without loading the TTS model, and adds Whisper's language detection to an older sidecar without language).
  • Where it is reported: voices.list (reference_language, reference_languages), the voice.warm event, voices.reference_candidates (reference_language, for reference.wav).

Which clip speaks language L (unchanged): reference_L.wav when it exists, else reference.wav (or the native clip with accent:"native-us", see below). The answers of tts.generate, redub.dub (review:false) and redub.render (respeak), and their tts.done / redub.done, carry:

  • "reference_language": the language of the clip that speaks (L for reference_L.wav, the detected language of reference.wav, "en" for the native clip; null while unknown);
  • "reference_foreign": true when that clip is known to be in another language than L (its accent carries over);
  • "reference_note" (only when foreign): a sentence for the user, e.g. "The reference clip is Ukrainian speech, so the English carries a Ukrainian accent. Add an English reference clip in Voices, or choose the native accent." It is separate from accent_note (which says why native-us was not used): both can apply at once.

The end event reads the sidecar again, so a clip transcribed for the first time by that job is reported correctly there even when the answer still said null. voice.json language is never rewritten from the detection.

App side. VoiceInfo.reference_language comes from voices.list and is refreshed by voice.warm and by the end events of jobs spoken from reference.wav. The Voices reference section shows it under the clip in use ("Ukrainian speech · detected in this clip", or "not checked yet"); when it differs from the voice's language and that language has no reference_<lang>.wav, a warning line follows ("English will carry this clip's accent. Add an English clip under Other languages, or train the voice for a native accent."). A reference_note (from the answer, else from the end event) is shown as a warning toast, joined with an accent_note when both come.

shutdown

{} -> {} then exit.

Audio formats (import and export)

One shared layer (engine/src/mimvox_engine/media.py) reads every audio input of the engine (recording.check, dataset.add, voices.import, redub.*) and writes every export. WAV, FLAC and AIFF are read natively; everything else (and anything the native reader refuses) is decoded by ffmpeg to mono float samples (the first audio track; video files give their audio). A file without an audio track is bad_request ("This file has no audio track."), an unreadable file bad_request, a missing file not_found.

ffmpeg location (first hit wins): the MIMVOX_FFMPEG environment variable (a folder or the ffmpeg file), the Applio runtime root (paths.applio in runtime.toml: on Windows Applio's prerequisites put ffmpeg.exe and ffprobe.exe there), then PATH. On Linux setup.sh installs the system ffmpeg package (it is in the package set, which also provides ffprobe); on macOS setup runs brew install ffmpeg when Homebrew exists, otherwise it stops with that instruction. Setup's quick check verifies both executables and that whisper imports. Without ffmpeg only WAV, FLAC, OGG and AIFF can be read, and audio.export falls back to libsndfile (wav, mp3, flac, ogg, aiff, no quality control); anything needing ffmpeg answers not_ready.

formats.list

(All lists are plain lower-case extension strings without a dot.) {} -> {"import":["wav","mp3","m4a","aac","flac","ogg","opus","wma","aiff","mp4","mkv","mov","webm","avi"], "import_video":["mp4","mkv","mov","webm","avi"],"export":["wav","mp3","flac","ogg","opus","m4a","aiff"], "export_video":["mp4","mkv","webm","mov"],"qualities":["high","standard","small"],"ffmpeg":"ffmpeg version ..."|null}

  • The lists reflect what the found ffmpeg can demux/decode (import: lower-case extensions without a dot, wma appears only when the build has a WMA decoder) and encode (export). import_video is the subset that are video containers. Use it to fill file pickers; the engine ignores the extension when decoding (it probes the content).
  • export_video: the containers video.export can write, those this ffmpeg has a picture and a sound encoder for (H.264 and AAC for mp4 / mkv / mov, VP9 or VP8 and Opus or Vorbis for webm); [] without ffmpeg.

audio.export

{"path","format":"wav|mp3|flac|ogg|opus|m4a|aiff","dest"?:"<absolute file path>","quality"?:"high|standard|small"} -> {"path","size_bytes"}

  • Converts any readable audio file (a tts.done / redub.done / tts.chunk file, a dataset part, an imported file) to format. quality (default standard) only matters for lossy formats:

    format codec high / standard / small
    wav PCM 16-bit, 44.1 kHz (lossless, no quality)
    flac FLAC 16-bit, source rate (lossless, no quality)
    aiff PCM 16-bit big-endian, 44.1 kHz (lossless, no quality)
    mp3 LAME, 44.1 kHz 320 / 192 / 128 kbps
    ogg Vorbis, source rate quality 7 / 5 / 3 (about 224 / 160 / 112 kbps)
    opus (.opus, Ogg container) Opus, 48 kHz 128 / 96 / 64 kbps
    m4a AAC-LC in MP4, 44.1 kHz 256 / 192 / 128 kbps
  • Default dest: next to the source with the new extension (.../20261111_101112.wav -> .../20261111_101112.ogg; when that is the source itself, <name>_export.<ext>). An existing dest is replaced (written to a temporary file first). The file is mono or stereo as the source is; tags/cover art are dropped.

  • Errors: bad_request (unknown format / quality, relative or folder dest, dest equal to the source, unreadable source), not_found, not_ready (ffmpeg or the needed encoder missing).

video.export / video.cancel

{"path","dest","format":"mp4|mkv|webm|mov","subtitles":null|{"position":"bottom|top"},"images"?:[{"path","start"?}], "transitions"?:false,"sidecar"?,"segments"?:[{"start","end","text"}],"segments_path"?} or, in place of path, "parts":[{"path","segments"?,"segments_path"?,"image"?}] -> {"job"} at once, then events.

  • Makes a video of a result (a Speak take, a Redub result, a Design take), or of several sound files in a row (the chapters of a book). path is the result file: its audio, or the video of a Redub result (video_path). dest is an absolute file path ending in .<format>; an existing file is replaced (written to <dest>.part-<pid>.<format> first).

  • parts (not with path, sidecar, segments or segments_path, which go into each part): sound files only (a part with a picture is bad_request), their sound joined in order into one track: each resampled to 48 kHz (stereo when any part is stereo, else mono) and padded or cut to its probed length, so part k starts exactly at the sum of the lengths before it; the joined sound is always encoded. A part's image is shown from the part's start until the next picture starts. images may be given too: their pictures (evenly spaced over the whole video, or from their starts, which then need not begin at 0) are merged with the parts' by time; at the same start the part's picture wins, and the video is black before the first picture.

  • Audio path: a 1920x1080 picture over the sound. images empty or absent: black. Otherwise each picture fills its time: none with start: evenly spaced (10 pictures in 60 s: one every 6 s); every one with start (seconds, the first 0, ascending, each before the end): from its start to the next one's. A picture is drawn once, before encoding: itself stretched to fill the frame and blurred as the background, and on top at its own aspect ratio, fitted inside the frame and centred. transitions: true (with pictures; not a boolean: bad_request): the first picture fades in from black and each picture into the next over 0.6 s (shorter when a picture shows for less), eased, in 25 fps steps drawn as stills. The video has a frame where the picture or a subtitle changes, at each fade step, and at least one a second (variable frame rate), so only those frames are encoded: the hardware H.264 encoder (below), else libx264 veryfast CRF 20 stillimage (else libopenh264, else mpeg4) for mp4 / mkv / mov, libvpx-vp9 realtime cpu-used 8 CRF 32 (else libvpx) for webm. When an encoder fails, the video is encoded again with the next one. Sound: AAC 192 kbps (mp4 / mkv / mov) or Opus 160 kbps (webm, else Vorbis q6) at 48 kHz, copied when a single result is already AAC (Opus for webm). The video lasts as long as the sound. Measured (16 threads): 10 min of speech with two pictures and 150 subtitles: 2.9 s to mp4, 3.1 s to webm; 2.4 s to mp4 without subtitles. 60 min in 10 MP3 parts, each with its 3000x2000 picture and 100 segments (2000 cues): 15.2 s to mp4 with h264_nvenc (RTX 4070), 18.2 s with libx264, 20.7 s to webm; encoding the hour's AAC alone takes 12 s of it. On 4 cores with a Vega iGPU: 51 s with h264_vaapi, 77 s with libx264.

  • Hardware H.264: the first of h264_nvenc (-preset p4 -rc vbr -cq 23 -b:v 0), h264_qsv (-global_quality 23), h264_amf (Windows, CQP 23), h264_videotoolbox (macOS, -q:v 65), h264_vaapi (Linux with /dev/dri/renderD128, CQP 23, frames uploaded with hwupload) that this ffmpeg has and that encodes a 1-second 256x144 test (ffmpeg lists encoders the machine has no device for). Probed once per engine process and logged; none works: libx264. Quality 23 matched libx264 CRF 20 (SSIM 0.963 on noisy 1080p with NVENC). Redub's burned subtitles and its Subtitle video mode use the same encoder. A video source that is re-encoded is decoded with -hwaccel auto (the frames come back to memory, so the filters work; without a usable device ffmpeg decodes in software).

  • Video path (images are ignored): the same container as dest and no subtitles: a plain file copy (copied:true). Another container: the picture and the first audio track are remuxed (-c copy) when the container takes their codecs, else re-encoded (H.264 / AAC for mp4 / mkv / mov, VP9 / Opus for webm, as above without stillimage). With subtitles the picture is always re-encoded with them drawn in.

  • Subtitles (subtitles null: none). Drawn into the picture at the bottom or the top, as Redub draws them (cues of at most two lines, ASS through ffmpeg's subtitles filter, see Video output step 5). The text and its timings (seconds of the file or of the part) come from, the first that is given:

    1. segments (lines outside the file are cut or dropped): source "given";
    2. segments_path: a book's segment file (<data>/books/<id>/segments/<NNN>.json) or any JSON object with "segments":[{"start","end","text"}], such as a .result.json (not_found when missing, bad_request without a segments list): source "recorded";
    3. the result's sidecar (<name>.result.json next to the file) or the file sidecar names (a Design take's take.json): its "segments" when it has them: source "recorded";
    4. else its "text", split into sentences (at . ! ? … and the CJK stops, and at line ends) and laid over the speech found in the sound (frames of 20 ms within 30 dB of the loud part, pauses under 0.3 s bridged): each sentence gets its share of the speech by character count, and a break between sentences moves to a pause within half a sentence of it: source "estimated" (instant, no transcription);
    5. no text (a Redub result from before the text was kept): no subtitles, and subtitle_note says why.

    Each part's lines are moved by its start; source is estimated when any part's lines were estimated, else recorded when any came from a file, else given, and subtitle_note names the parts without lines. An ffmpeg without libass draws none either, with a subtitle_note. The font follows the sidecar's language, else the language guessed from the text's script.

  • Events: video.progress {"stage":"prepare|encode","pct"} (pct 0-100 over the whole job: prepare (text, timings and pictures) 0-10, encode 10-100, about once a second), then video.done {"dest","duration_s","copied", "subtitles":null|{"lines","source":"recorded|estimated|given"},"subtitle_note"?,"parts":[{"path","start", "duration_s"}]} (duration_s: the written file's; subtitles null when none were asked or none could be made; parts: where each part starts in the video and how long it is, seconds to 3 decimals, one entry for path) or video.error {"code","message"} (cancelled, bad_request for a picture ffmpeg cannot read, not_ready, internal). A failed or cancelled export leaves no new file at dest.

  • Errors at start: bad_request (format, dest, subtitles, images or a start, parts, segments, segments_path; a path or a part without audio, a part with a picture), not_found (path, a part, a picture, segments_path or sidecar missing), not_ready (no ffmpeg, or no encoder for format), busy (another video export runs: one at a time).

video.cancel {"job"?} -> {"cancelled":bool}: stops that export (without job: the one running); it ends with video.error cancelled. cancelled is false when no such export runs.

subtitles.export (a subtitle file)

{"format":"srt|vtt|sbv","dest","segments"?:[{"start","end","text","words"?}],"segments_path"?,"path"?,"sidecar"?} -> {"path","cues","source":"given|recorded|estimated","size_bytes"}

  • Writes timed lines as a subtitle file, the alternative to burning them into a video: SubRip (srt), WebVTT (vtt) or SubViewer (sbv, YouTube's own). dest is an absolute file path ending in .<format>; an existing file is replaced (written to <dest>.part-<pid> first). UTF-8 without a BOM.
  • The lines come from, the first that is given: segments (with Whisper's words, as redub.render takes them, cues are timed by the words), segments_path, or the result file path and its sidecar (or sidecar), exactly as the subtitles of video.export (source as there; an estimated result is decoded, so it needs ffmpeg for a file soundfile cannot read).
  • Cues as burned subtitles have them (Video output step 5): a sentence per cue, a long one split at its clauses, at most two lines of 42 characters, never overlapping. Times in milliseconds (00:00:01,500 in SRT, 00:00:01.500 in WebVTT, 0:00:01.500 in SBV), hours past 99 as they are. WebVTT text has &, < and > escaped; SRT and SBV have no escapes (an SRT backslash is followed by a zero-width space, so players do not read \N or {\...} as tags). Runs of whitespace become one space.
  • Errors: bad_request (format, dest, segments, segments_path, sidecar, none of them with path, a file with no saved text, no line with a text and a length), not_found (path, segments_path or sidecar missing).

Audiobooks (text.import, book.*)

Speak has two modes: Text (tts.generate, above) and Book, which reads a whole document in the active voice with the same settings and writes one file per chapter. A book is one engine job that can be paused, resumed (also after the app or the engine closed in the middle) and cancelled. The engine owns the book's state on disk; the app only shows it.

text.import (read a document)

{"path":"<absolute path>","language"?:"auto"|"<code>","split"?:"auto"} -> {"path","name","format","format_label","title","encoding","language","language_detected","words","chars","est_s", "chapters":[{"title","text","words","chars","est_s"}],"parts":null|{"how","chapters":[...]},"warnings":["..."], "meta":{"authors":["..."],"description","language_tag","date","cover":null|{"path","media_type"}}}

  • Formats (by extension): .txt (any encoding: a BOM, else strict UTF-8, else BOM-less UTF-16, else cp1251 or cp1252 by which gives plausible letters; encoding names the one used), .md/.markdown, .html/.htm/.xhtml, .epub, .docx, .odt, .rtf, .fb2 (and .fb2.zip), .pdf (the text layer only), .srt, .vtt. Read with the standard library (zipfile + ElementTree for EPUB, DOCX, ODT and FB2; html.parser; a small RTF reader of its own) and pypdf for PDF (installed by setup; missing -> not_ready). Not read aloud: Markdown code blocks, footnotes and note references, page numbers, picture captions, subtitle sound tags such as [MUSIC], tables of contents.
  • Chapters come from the format's structure: the EPUB navigation (nav.xhtml, else toc.ncx) mapped onto the spine, headings in Markdown / HTML / DOCX / ODT, nested FB2 sections, the PDF outline, and in plain text lines such as Chapter 1, CHAPTER IV, Розділ 1, Глава 3, Part Two, Prologue (at least two of them). Text before the first heading becomes its own chapter when it has at least 150 words; a title page is dropped. One chapter when nothing is found.
  • language with "auto": detected the same way among a wider set: Ukrainian, Russian, Belarusian and Bulgarian for Cyrillic (ї є ґ, ы э ё, ў and ъ tell them apart), and English, German, French, Spanish, Italian, Portuguese, Polish, Czech, Dutch and Romanian for Latin script.
  • parts (autoparts.py): a suggested split when a chapter is longer than 4,000 words (about 28 minutes), else null. The app shows it as Split automatically and applies it in the draft only (with Undo split). Language-independent, by the first rule that applies to each long chapter: headings (short paragraphs that look like unmarked chapter titles: the plain-text heading lines above, a bare number or Roman numeral, or a short line in capitals; at least two of one kind; a cluster of them with less than 150 words between them is ignored; those chapters stay whole), breaks (paragraphs of only * * * ⁂ # ~ § — and the like; whole scenes grouped into parts of about 1,800 words), length (even parts of about 1,800 words, cut between paragraphs by lexical cohesion as in TextTiling on 5-letter stems of ~300 words each side, preferring the end of a dialogue, never after a paragraph that does not end a sentence). how is that rule, or mixed. Titles: the found titles; for a file whose text is in one chapter "