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.
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 inruntime.toml([python] engine), withPYTHONPATH=<repo or bundle>/engine/src. The reading presets are found by walking up from the engine sources to the first folder that haspresets/<lang>/*.md(or a legacy flatpresets/*.md, read as English):<repo>/presetsin the repository and<RES>/presetsnext to<RES>/engine/srcin 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);modelsin thereadydata isloadingfor both until themodelsevent 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):ttsisreadyonce 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*.cancelcancels. 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 inReadFileon 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 theredub.preparedeadlock). 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 byidand turnsprogresslines 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 (anyprogressline about it starts that one again); past either the worker is killed and the request fails withinternal("the omnivoice worker timed out in synth" / "made no progress for 600 s in synth"). shutdown/ stdin EOF. The engine answersshutdownwith{}, 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 answerscancelled. 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:
MIMVOX_DATAenvironment variable (an absolute path);- the pointer file
location.tomlin the fixed per-user config folder, contentdata_dir = "<absolute path>"; - 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),namein English,nativein the language itself, the common ones first (common: true, in the orderen uk de fr es pl ro it pt cs ru), then the rest by English name. The same list is in thereadyline and answerstts.languages {}->{"languages":[...]}.device.vendoris[device] vendorfrom runtime.toml, left out when it is not set. The app shows the backend as ROCm foramd.device.nameis read fromnvidia-smifor 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_gbis the total VRAM rounded to 0.1 and is0.0for MPS and CPU.models:loadinguntil the model is loaded,missingwhen it could not be loaded,no_memory(withtts_message) when the CPU has too little RAM for it. Themodelsevent saysreadyonly 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/ornllb-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), soaccent: "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'sCOMPONENTS):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) andukrainian(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,voxcpmandchatterboxare the voice-cloning models, at least one of them installed (see Other voice-cloning models). Withouttrainingruntime.toml has no[python] rvc/[paths] applioandmodels.rvcismissing. Read at engine start.speech_models: the installed and turned-on voice-cloning modelstts.generateandbook.startmay name inmodel(omnivoice,voxcpm,chatterbox, in that order), each with the language codes it speaks anddesign: it makes voices from a description (voices.design; OmniVoice and VoxCPM2).languagesis their union, plus Ukrainian with HolosTTS.components_off: installed parts the user turned off (<data>/components.json,{"off":[...]}). They are left out ofcomponents,translatorsandzero_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...}}
bookandbook_role(narrator,men,women) mark a voice Book made for a book; they are stored invoice.jsonand returned byvoices.list(nullfor other voices), so the app lists such voices apart.- Creates a voice, then: every
part<N>.<ext>indataset_dir(any importable extension,wavby default) goes throughdataset.add(trim, normalise, verdict; the reference is chosen by it);reference_path(any importable format), when given, replacesreference.wavas it is (converted to mono 16-bit WAV, no trimming; a laterdataset.add/dataset.removepicks the reference again);rvc_model(andrvc_index) are copied torvc/model.pth/rvc/model.indexand the voice is markedtrainedwithtrained_epochsread from a..._<N>e_...file name when present and"imported":trueinvoice.json. - Needs at least a
reference_pathor adataset_dir;rvc_indexneedsrvc_model. Errors:bad_request,not_found(a path is missing). On any failure the half-made voice is removed again. rvc_modelmust be an RVC v1/v2 or Applio voice model: a PyTorch file (zip or the legacy format) whose pickle namesweight,configandemb_g.weight. Only the pickle's opcodes are read (pickletools), nothing is unpickled; anything else (a.zipholding the model, a G_/D_ training checkpoint, another kind of.pth) isbad_requestwith a message for the user, before the voice is made.{"bundle","name"?}imports a voice bundle instead (see Voice bundles);bundlecannot 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
textin a new voice made fromdescription, with no reference clip, and keeps it as a take in<data>/design/<id>/(voice.wav,speech.wavwhen HolosTTS read it,take.json); only the last 40 takes are kept.pathis the clip to play (WAV;audio.exportwrites it in another format),referencethe designed voice:voices.import {"name","reference_path":reference,"language"}keeps it as a voice. model:omnivoiceorvoxcpm(a model whosespeech_modelsentry hasdesign); absent orauto: the first of them installed that speakslanguage(OmniVoice before VoxCPM2).descriptionforvoxcpmis any words ("a deep, calm male voice"); foromnivoiceit is comma-separated OmniVoice terms: gender (male,female), age (child,teenager,young adult,middle-aged,elderly), pitch (very low pitch...very high pitch),whisperand, for English, an accent (american accent,british accent, ...). Empty lets the model choose.texthas no length limit (OmniVoice reads a long one in pieces, one after another, in the voice of the first),descriptionat 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_stressand HolosTTS installed: HolosTTS readstextin the designed voice (and the zero-shot converter brings its timbre back when installed), astts.generatereads Ukrainian;pathis 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
textit fits best; one that matches less than 60 % (OmniVoice now and then makes only hiss) is made again, up to 3 times;clearsays whether the kept take passed. VoxCPM2 takes are not heard (clearnull): 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 withbusy("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.designthen answerscancelledand keeps nothing.falsewhen 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_foundfor 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.wavandreference.omnivoice.json, everyreference_<lang>.wavandreference_<lang>.omnivoice.json,rvc/model.pthandrvc/model.index; each only when present exceptvoice.jsonandreference.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.jsonis stored withouttraining_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"}]}(filesas in the answer).voice.jsonandmanifest.jsonare 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
versionwould 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
speedwithtts.generateandredub.render(respeak) and remembered asspeedin<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 thevoices.reference_candidateswith 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
quickpreset, or a built-in sentence), record with the Record screen's recorder or import a file,recording.check(expected_s10), 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 ornull, nothing is detected (languagenull,language_setfalse); anything else isbad_request. Whisper turbo (the speech worker'sdetect_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 islanguagewhen it has at least half of the total and the speech model speaks it (elsenull). Without the Whisper model, or when the worker fails,languageisnulland the request goes on.voice_id(withlanguage"auto"): a voice that has no recordings (dataset/part*.wav) and no trained model takes the detected language as itslanguageinvoice.json(language_settrue); 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_foundfor an unknown voice.- App side. Record's "Use recordings you already have" creates the new voice (
voices.createwith the reading language as a stand-in), sendsmedia.combinewith"language":"auto"and itsvoice_id(the same for "More recordings of" an empty active voice), then stores the result withdataset.add; whenlanguage_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 isreference.wav(a manual choice, recorded inmeta.jsonreferencewith"source":"media"). Another speech language:reference_<language>.wav(likevoices.add_reference;voices.listthen lists it inreferences).remove_music:true(separate every file),false(never) or"auto"(the default;nulltoo): 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'sseparate_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 (asdataset.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 (asdataset.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 asunused. - 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);medianis the median rate of the pool's files. The best 24 distinct windows are stored inmeta.jsonmedia.cands; the best one is written to the target, its.omnivoice.jsondeleted, the conditioning cache dropped and (forreference.wav)voices.warmstarted. - The pool,
meta.jsonmediaand 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"?}(file1-based andnamewhile a file is decoded, separated and cleaned:decodeandseparateshare 0-85, file k of n taking its 1/n of it;separateis file k's middle 80 %, loading the model included), thenvoices.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"}orvoices.media.error {"code","message","skipped"?,"music_*"?}(cancelled;bad_request"None of the files has usable speech." withskippedand themusic_*fields;not_found,internal).music_reasonsays 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). Eachmeta.jsonmedia.files[]entry hasmusic_removedandmedia.music_removedcounts the separated files.appliedis false (with amessage) when a generation started meanwhile (pick a clip withvoices.set_referencelater) or no 8-12 s window was found. - Errors at start:
bad_request(pathsnot a non-empty list of strings, more than 500 files,languagenot 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_musictrue / false; it is remembered asremove_musicinsettings.json, and until the user sets it it is ticked when the engine reportsdevice.backendcuda. 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
languageaccept the code in any case and with a region ("uk-UA","en_US"->uk,en). Anything else isbad_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_phonemesare those of the language's inventory (ARPAbet for English, IPA otherwise). - The language of a voice (
voices.create/voices.importlanguage) 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 (hellolanguages). - App side. Record has a "Reading language" menu with search (the
presets.listlanguagesthat an installed speech model speaks, remembered asrecord_languageinsettings.json); "Use my own text" offers "Detect" or one of them (text.analyzelanguage). A new voice is made in the language that is read; an empty active voice in another language is switched to it (voices.renamelanguage); 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 withdataset.addstart_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"andnullalso mean"en").languageslists every language that has presets, English first, so the app can offer a language picker. A supported code without presets, or an unsupported code, isbad_request. A missing presets folder isnot_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.
titleanddescriptionare UI strings (English); parttitleandtextare in the preset's language.est_secondsuses 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,nullor"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 ї є ґ, ä ö ü ß, ą ę ł ś ż, ñ ¿ ¡, è ç œ;enwhen nothing points elsewhere, also for an empty text);language_detectedtells 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.unitis"characters"for a language written without spaces:wordsthen counts letters. phoneme_coverageis the share of the language's inventory (phonemes_totalphonemes) the text contains;missing_phonemesare in the inventory's order. Coverage under the language's threshold (0.80 for every language today) lowerstrainable/greatby one level; under 0.95 themessagenames 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 hasphonemes_total0,phoneme_coveragenulland nomissing_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"?}: withstart_overthe voice first loses everything but its id, name and creation time (recordings, reference clips, media pool, trained model) and takeslanguage; 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-bitdataset/part<N>.wav(resampled to 44.1 kHz only above 48 kHz), replaces an older take of that part, refreshesreference.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_requestfor takes under 0.3 s or below 16 kHz;not_foundfor 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_minutescounts only parts whose verdict is notbad;levelis computed from it (under 0.5 mintoo_short, under 3zero_shot, under 10trainable, elsegreat).recommended_epochsis0below 3 usable minutes (not trainable), otherwise exactly whattrain.startwithepochs: nullwould use (300 * sqrt(6.4 / minutes)clamped to 150..450, rounded to 10).has_reference:reference.wavexists.reference(present only then):{"part","start_s","end_s","duration_s"}, the clip cut from that part (plus"manual":trueaftervoices.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",...}(nopart). Aftervoices.importwith areference_pathit 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.indexonly 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 ortts.cancelit first),paused(this voice has a paused or interrupted training andrestartis nottrue). - GPU hand-over. The training runs inside
tts.gpu_released: whentrain.startanswers, the OmniVoice worker and the RVC worker are stopped, so bothmodelsentries areloading(amodelsevent is sent) andtts.generate/voices.warmanswernot_readyfor 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,modelsevents,readyagain), 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"}withcancelledorinternal(out of memory is reported in plain words);train.paused(see below).pctis overall (preprocess 0-5, extract 5-15, train 15-95, index 95-100).epochis 0 outsidetrain/indexand 1-based while training.total_epochsis the planned count.eta_sisnulluntil three epoch ends have been measured and alwaysnulloutside thetrainstage; afterwards it is the mean of the recent epoch times times the remaining epochs, plus 20 s for export and index.
- On success
voice.jsongets"trained":true,"trained_epochs"(the epochs actually done) and"trained_at"(local time,YYYY-MM-DDTHH:MM:SS), whichvoices.listreports. The full Applio output is kept in<data>/tmp/train_<voice_id>.loguntil 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 thetrainstage (not_readybefore that: preprocessing and feature extraction cannot be paused;not_foundfor 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.donearrives instead oftrain.paused). Then the Applio process tree is stopped, Applio's folder is kept,voice.jsongets"training_paused":{"epoch","total_epochs","model_name","paused_at",...}, and the eventtrain.paused {"voice_id","epoch","total_epochs","paused_at","reached_epoch"}(job = the training job) ends the job.epochis the epoch of the saved checkpoint (where a resume continues),reached_epochhow far the training had got. The speech models are reloaded at once (the GPU hand-over is closed like aftertrain.done:modelsevents,readyagain after about 50 s), so Speak and Redub work while paused.train.resume {"voice_id"}->{"job"}. Hands the GPU over again (samebusy/not_readyrules astrain.start; the models must beready, 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 startscore.py trainwith the same total epochs, batch size and cache setting.train.progresscontinues from the saved epoch: the first event isstage:"train"withepoch= the saved epoch and thepctthat epoch had before;eta_sisnullfor the first three epochs. Afterwards the index is built and the model copied as usual andtraining_pausedis 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; withoutrestartit answerspaused("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 clearstraining_paused->{}.busywhen that voice is training right now. Cancelling a running job always discards its checkpoints, too.voices.deleteremoves the Applio folder as well.- Interrupted runs. While a training runs,
voice.jsonholds 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 answersready, stops Applio workers that survived (the PIDs are in Applio'sconfig.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.listthen shows it andtrain.resumeworks as after a pause. Applio folders are never cleaned at engine start (only<data>/tmpis). A run that fails while learning (for example out of memory) keeps its latest checkpoint the same way (train.errormessage 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.pauseand quits ontrain.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 showspause k/Nwhile a run is paused, the Voices card "Paused k/N" (or "Interrupted k/N"). voice.jsonkeys written by training:training_run(internal, only while running),training_paused(epoch,total_epochs,model_name,paused_at,interrupted?plus internalssteps_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) andclass_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.jsonlanguage, defaulten) 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),0skips RVC. Out-of-range numbers are clamped, non-numbers arebad_request.speed(0.8-1.3, default 1.0, clamped like the other numbers): speaking speed, OmniVoice'sspeedcontrol (the model sizes the speech to1 / speedof its natural length; pitch unchanged, RVC afterwards as usual). Every segment uses the same value. The tempo copied fromreference.wavis the baseline, sospeedis relative to that clip (seevoices.reference_candidates).quality:best(default, 32 OmniVoice decoding steps) orfast(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 oftext, an ISO 639-1 code from the list in Speech model and languages; another code isbad_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'slanguage, a different choice is remembered per voice insettings.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 ofwav mp3 flac ogg opus m4a aiff(asaudio.export, see Saved results).- Errors:
bad_request(empty text, badquality, unknownlanguageoroutput_format),not_found(voice, or it has noreference.wav),not_ready(models loading, missing, or handed over to training; oroutput_formatcannot be written on this machine),busy(another generation is running; only one at a time). - The text is cut into
segmentspieces: 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_charslets a client estimate the remaining speech per segment. - Defaults: OmniVoice fp16, 32 steps (16 for
fastand 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), thentts.done {"path","path_play","format", "duration_s","elapsed_s"}(see Saved results), ortts.error {"code","message"}(cancelledaftertts.cancel;no_memorywhen the RAM is too small or full, see RAM on the CPU; the slot is free again when the event arrives).ready_sis the wall time from the start of the job to this chunk;rtfis the wall time since the previous chunk (or the start) divided by this chunk's speech seconds, sortf < 1means 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, ....
wavis 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 theaudio.exportencoders at qualityhigh(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:pathitself forwav, else the playback WAV intmp/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>.wavin 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; seeformats.listexport) isnot_ready. - App side: the Results headers of Speak and Redub have a "Save as WAV" chip (one setting for both,
output_formatinsettings.json, defaultwav); it lists the formats offormats.listexport. The app playspath_play, and "Show in folder", "Open file" and "Export as..." usepath(an export encodes frompath_playwhile it exists). Fieldspath_wav/path_mp3of 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; aredub.renderwith"result_mode":"dub"recordsdub),"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: novoice_id,voice_name,accentorto. 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 nosegments, nor has a sidecar written before the field existed.outputs.listdoes not return them.path/video_pathare the absolute paths at save time;outputs.listuses the files found next to the sidecar, so a moved data folder still works.outputs.deletedeletes 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
rtfof the later chunks near 1 (measured 1.05-1.4). A client that wants to avoid underruns on slower hardware estimates the total speechS = duration_s(chunk 0) * sum(segment_chars) / segment_chars[0]and holds chunk 0 back formax(0, rtf * (S - duration_s(chunk 0)) - S)seconds, takingrtffrom chunk 0 (a first estimate) and refining it with each new chunk. Withrtf <= 1this 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 bycreated, at mostlimit(default 50, at most 500; not a positive integer isbad_request), only those ofkindwhen given, only those withcreated<beforewhen given (the next page:before= the last entry'screated).moresays 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'svoice_id,voice_name,text,language,accent,mode,source_name,towhen 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 withexternal: true(legacytrue too): audio asspeak, a video without audio of the same stem asredub;<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 getsname,created(the file's mtime),duration_s(read from the file: libsndfile, else ffprobe; cached for the session by path, mtime and size) andformat;elapsed_sand the sidecar fields arenull/ absent. A sidecar whose files are gone is skipped. pathis the audio file (a video-only result: the video);path_playis a WAV that plays it now without decoding (pathitself for a WAV, or this session's copy intmp/play), elsenull: then askoutputs.play.- App side: once the engine is ready Speak and Redub each ask for their kind (
limit50) and fill their Results panels; results finished this session go on top. "Show older" at the bottom (shown whilemore) asks withbefore. 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.playfor a Speak / Redub result:path_playispathitself 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. pathmust be absolute and inside<data>/outputs(resolved through symlinks) elsebad_request; a missing file isnot_found; an undecodable onebad_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(thepathof atts.done/redub.done) and, when given,path_play(its playback WAV; omit it, or send the same path, for awavresult). Only regular files inside<data>/outputsor<data>/tmp/playcan 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 withbad_requestand deletes nothing. - Files in
<data>/outputswith the same name aspathand another extension go too: they belong to the same result (a Redub of a video savesredub_<stamp>.<audio ext>andredub_<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) isinternalwith 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; thenipa-ukmakes 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; defaulttrue):falsespeaks 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 withexact_stress, for"omnivoice"too);"omnivoice","voxcpm"or"chatterbox"names one. A named model that is not installed isnot_ready, one that does not speaklanguageisbad_request, any other value isbad_request. A book keeps the value it started with. The reply oftts.generateandtts.donesay 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
modelsevent 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_GBsets it). On a 12 GB card a switch between models costs 10-20 s. - Reference. The worker clones from the clip (
reference_<lang>.wavwhen 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). Withaccent: "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
speedwith ffmpeg (pitch kept).qualityis VoxCPM2's diffusion steps (10 Best, 6 Fast);expressivenessis 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 throughnum2words. 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 inuk,ruandbetext 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-stressin dictionary-only mode withmarisa-trie, installed by setup, offline) is off by default:MIMVOX_STRESS_AUTO=lastmarks unmarked Ukrainian words stressed on their last syllable,allevery 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.wavused 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 inreference.omnivoice.jsonwith 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.jsonlanguage, defaulten). For speech in another language the index rate ismin(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_INDEXoverrides 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,warmorinspectcall 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 sendsprogressat 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,synthandinspectbefore 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_GBchanges it):no_memorywith "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 whenbackend = "cpu", before it starts the worker, and the worker'sloadmakes it when no GPU turned out to be usable: either way nothing is loaded andmodelsreportstts: no_memorywith this message astts_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_memorywith "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_memorywith "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 withbook.errorno_memoryand that message. After the other two a Book showsstage: "memory"and retries.tts.generateends withtts.errorno_memoryand the message in both cases. On a GPU or MPS neither check runs.- less than 11 GB of RAM in all (the worker plus about 3.5 GB for the system, the engine and the app;
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.dubandredub.render(respeakonly; ignored byconvert):"accent": "own" | "native-us"(defaultown: the voice's own reference, as before) and"native_voice": "auto" | "male" | "female"(defaultauto). Other values arebad_request. - When it applies: the speech is English (
languageoftts.generate,target_languageofredub.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) withvoice_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 ARCTICbdl) anden-us-female.wav(slt), US English, about 11.5 s, mono 24 kHz;en-us-<gender>.txtis the transcript (sent to the worker asref_text, so no Whisper pass and no.omnivoice.jsonsidecar: the folder may be read-only);voices.jsonlists them with their median F0 (116.6 and 182.9 Hz); the licence isCMU_ARCTIC_COPYING.txtnext to them. Rebuilt bytools/release/make_native_refs.py. - Speaker:
autopicks the native speaker whose median F0 is closest on a log scale to the median F0 of the voice'sreference.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/femaleforce 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 ratemin(voice_match, 0.2)(MIMVOX_RVC_NATIVE_INDEXoverrides 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 workerconverttakes"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.wavas the target (its first 20 s). Diffusion steps follow the job'squality: 12 forbest, 8 forfast(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 (pitch0);voice_matchdoes not apply. Each segment is converted as it is produced, like RVC (streaming unchanged). Workerzsvc_worker.py, run with the engine interpreter (python -I zsvc_worker.py --seed-vc <dir> --models <dir> --device cuda|cpu|mps; wire formatworker_kit.py): opsload {}->{"load_s","device","vram_gb"},convert {"in","out","ref","steps"?:12, "cfg"?:0.7}->{"elapsed","duration_s","sr"}(outa 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 (hellodevice.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), andspeech.yield_gpustill runs before the job. - Results: the
tts.generateanswer, theredub.dubanswer (review:false) and theredub.renderanswer (respeak) carry"accent"(what the job does:own|native-us); withnative-usalso"accent_converter":rvc|zero-shot.tts.doneandredub.donecarry them too, plus"native_voice"(male|female) and"pitch"(the RVC transpose; 0 with the zero-shot converter) when it isnative-us. Whennative-uswas asked but cannot be used they add"accent_fallback":not_english,no_converter(an untrained voice, orvoice_match0, and the zero-shot converter is not installed) orunavailable(the native clips are missing), and"accent_note", a sentence for the user. (untrainedandvoice_match_offof earlier versions are nowno_converter, or no fallback at all with the converter installed.) Aredub.dubwithreview:truespeaks nothing: sendaccentagain with theredub.renderthat 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 ofreference.wav(all included in thevoice.warmit ends with;already_warmonly 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 betweenownandnative-usrebuilds 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, andreference.wavis not English (its detectedreference_language, or while that isnullthe voice'slanguage; see Reference language). Redub shows the same in Translate & dub when "To" is English (sent withredub.duband with theredub.renderof 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 itsredub.render). Native is the default; the choice is remembered insettings.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, withzero_shot_vc, "Native accent from your reference clip (no training needed); training makes it closer to you.". An untrained voice withoutzero_shot_vcshows 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.warmis sent with the accent whenever Native is possible and chosen for a voice without an English clip. Anaccent_noteis 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>.wavare 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 sidecarreference.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 ofen 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 nextvoices.warmor generation from that clip.voices.warmalso asks the worker toinspectthe clip when the language is still unknown afterwards (worker opinspect {"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 withoutlanguage). - Where it is reported:
voices.list(reference_language,reference_languages), thevoice.warmevent,voices.reference_candidates(reference_language, forreference.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 (Lforreference_L.wav, the detected language ofreference.wav,"en"for the native clip;nullwhile unknown);"reference_foreign":truewhen 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 fromaccent_note(which says whynative-uswas 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,wmaappears only when the build has a WMA decoder) and encode (export).import_videois 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 containersvideo.exportcan 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.chunkfile, a dataset part, an imported file) toformat.quality(defaultstandard) only matters for lossy formats:format codec high / standard / small wavPCM 16-bit, 44.1 kHz (lossless, no quality) flacFLAC 16-bit, source rate (lossless, no quality) aiffPCM 16-bit big-endian, 44.1 kHz (lossless, no quality) mp3LAME, 44.1 kHz 320 / 192 / 128 kbps oggVorbis, source rate quality 7 / 5 / 3 (about 224 / 160 / 112 kbps) opus(.opus, Ogg container)Opus, 48 kHz 128 / 96 / 64 kbps m4aAAC-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 existingdestis 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(unknownformat/quality, relative or folderdest,destequal 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).
pathis the result file: its audio, or the video of a Redub result (video_path).destis an absolute file path ending in.<format>; an existing file is replaced (written to<dest>.part-<pid>.<format>first).parts(not withpath,sidecar,segmentsorsegments_path, which go into each part): sound files only (a part with a picture isbad_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'simageis shown from the part's start until the next picture starts.imagesmay be given too: their pictures (evenly spaced over the whole video, or from theirstarts, 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.imagesempty or absent: black. Otherwise each picture fills its time: none withstart: evenly spaced (10 pictures in 60 s: one every 6 s); every one withstart(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 libx264veryfastCRF 20stillimage(else libopenh264, else mpeg4) for mp4 / mkv / mov, libvpx-vp9realtimecpu-used8 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 withhwupload) 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(imagesare ignored): the same container asdestand 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 withoutstillimage). With subtitles the picture is always re-encoded with them drawn in.Subtitles (
subtitlesnull: none). Drawn into the picture at the bottom or the top, as Redub draws them (cues of at most two lines, ASS through ffmpeg'ssubtitlesfilter, 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:segments(lines outside the file are cut or dropped):source"given";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_foundwhen missing,bad_requestwithout asegmentslist):source"recorded";- the result's sidecar (
<name>.result.jsonnext to the file) or the filesidecarnames (a Design take'stake.json): its"segments"when it has them:source"recorded"; - 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); - no text (a Redub result from before the text was kept): no subtitles, and
subtitle_notesays why.
Each part's lines are moved by its start;
sourceisestimatedwhen any part's lines were estimated, elserecordedwhen any came from a file, elsegiven, andsubtitle_notenames the parts without lines. An ffmpeg without libass draws none either, with asubtitle_note. The font follows the sidecar'slanguage, else the language guessed from the text's script.Events:
video.progress {"stage":"prepare|encode","pct"}(pct0-100 over the whole job:prepare(text, timings and pictures) 0-10,encode10-100, about once a second), thenvideo.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;subtitlesnull 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 forpath) orvideo.error {"code","message"}(cancelled,bad_requestfor a picture ffmpeg cannot read,not_ready,internal). A failed or cancelled export leaves no new file atdest.Errors at start:
bad_request(format,dest,subtitles,imagesor astart,parts,segments,segments_path; apathor a part without audio, a part with a picture),not_found(path, a part, a picture,segments_pathorsidecarmissing),not_ready(no ffmpeg, or no encoder forformat),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).destis 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'swords, asredub.rendertakes them, cues are timed by the words),segments_path, or the result filepathand its sidecar (orsidecar), exactly as the subtitles ofvideo.export(sourceas there; anestimatedresult 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,500in SRT,00:00:01.500in WebVTT,0:00:01.500in 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\Nor{\...}as tags). Runs of whitespace become one space. - Errors:
bad_request(format,dest,segments,segments_path,sidecar, none of them withpath, a file with no saved text, no line with a text and a length),not_found(path,segments_pathorsidecarmissing).
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;encodingnames 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) andpypdffor 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, elsetoc.ncx) mapped onto the spine, headings in Markdown / HTML / DOCX / ODT, nested FB2 sections, the PDF outline, and in plain text lines such asChapter 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. languagewith"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), elsenull. 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).howis that rule, ormixed. Titles: the found titles; for a file whose text is in one chapter "