ffmpeg/ffprobe; Python 3 with venv; Whisper for transcription; one open TTS toolkit that ships a fine-tuning recipe (for example Coqui TTS/XTTS or Piper — the exact commands differ per release, so check that toolkit's documentation); a GPU with enough VRAM for your chosen recipe; written consent from the family members whose voices you use.dataset/wavs/ plus a validated dataset/metadata.csv that any LJSpeech-style training recipe can read.models/family_voice_v1/ and a configs/finetune_voice.yaml you can re-run for the next training round.http://127.0.0.1:8080/speak that returns a .wav file for any text you POST to it.mkdir -p archive/raw archive/wavs dataset/transcripts dataset/wavs out models
ffmpeg -i archive/raw/tape_01.wav -af "highpass=f=80,lowpass=f=8000,afftdn=nf=-25,loudnorm=I=-16:TP=-1.5:LRA=11" -ar 22050 -ac 1 -sample_fmt s16 archive/wavs/tape_01_clean.wav
ffprobe -v error -show_entries stream=sample_rate,channels -show_entries format=duration -of default=noprint_wrappers=1 archive/wavs/tape_01_clean.wav
whisper archive/wavs/tape_01_clean.wav --model small --language en --output_dir dataset/transcripts --output_format tsvDetails and verification — in the steps below.

sudo apt install ffmpeg (Debian/Ubuntu) or brew install ffmpeg (macOS). Verify with ffmpeg -version.python3 -m venv .venv && source .venv/bin/activate.pip install -U openai-whisper. It downloads model weights on first run, so budget disk space. - [ ] Original recordings copied to archive/raw/ and never edited in place
- [ ] A backup of archive/raw/ on a second disk
- [ ] Consent confirmed for every speaker in the dataset
- [ ] ffmpeg -filters | grep loudnorm returns a line (the filter exists in your build)
What to do: inventory every source file, convert it to the format your toolkit expects, remove hiss and level jumps, then cut long recordings into short clips.
Why: TTS training reads short aligned clips. Cassette and reel-to-reel transfers carry hum, wow-and-flutter and uneven loudness; if you train on that, the model learns the noise as part of the voice.
for f in archive/raw/*; do
echo "== $f"
ffprobe -v error -show_entries stream=codec_name,sample_rate,channels \
-show_entries format=duration -of default=noprint_wrappers=1 "$f"
doneExample: the inventory prints sample_rate=44100, channels=2, duration=1832.400000 for tape_01.wav — a 30-minute stereo transfer that must become mono 22050 Hz for most recipes.
Cleaning and downmix:
ffmpeg -i archive/raw/tape_01.wav \
-af "highpass=f=80,lowpass=f=8000,afftdn=nf=-25,loudnorm=I=-16:TP=-1.5:LRA=11" \
-ar 22050 -ac 1 -sample_fmt s16 archive/wavs/tape_01_clean.wavWhy it works: highpass/lowpass cut rumble and tape hiss outside the speech band, afftdn is a noise reducer, loudnorm normalizes perceived loudness, and -ac 1 collapses stereo to mono. 22050 Hz / 16-bit / mono is a common training input format — confirm the exact rate your toolkit expects in its docs.
Find the quiet gaps, then cut clips of roughly a few seconds each:
ffmpeg -i archive/wavs/tape_01_clean.wav -af silencedetect=noise=-35dB:d=0.5 -f null - 2>&1 | grep silence_
ffmpeg -ss 00:00:12.400 -to 00:00:19.100 -i archive/wavs/tape_01_clean.wav -c copy archive/wavs/tape_01_0012.wavHow to check: ffprobe on a clip must show exactly one mono stream at your target rate:
ffprobe -v error -show_entries stream=sample_rate,channels -of default=noprint_wrappers=1 archive/wavs/tape_01_0012.wav
# sample_rate=22050
# channels=1If you see channels=2 or a different sample_rate, the conversion step did not apply — re-run the cleaning command on that source file.

What to do: transcribe every clip, write a metadata.csv manifest, validate it, and start the training run.
Why: a fine-tuning recipe needs two things: audio files and their exact transcripts. Mismatched transcripts teach the model wrong pronunciation, and a missing file aborts training halfway through.
Transcribe each clip (run per file or in a loop):
whisper archive/wavs/tape_01_0012.wav --model small --language en --output_dir dataset/transcripts --output_format tsvExample: the command writes dataset/transcripts/tape_01_0012.tsv; open it, fix names and numbers by hand, and keep only the text column.
Assemble the manifest — the standard LJSpeech-style format is file_id|text|normalized_text, and file_id is the filename without .wav:
# build_metadata.py — run: python build_metadata.py
import csv
from pathlib import Path
rows = []
for tsv in sorted(Path("dataset/transcripts").glob("*.tsv")):
lines = tsv.read_text(encoding="utf-8").strip().splitlines()[1:] # skip header
text = " ".join(l.split("\t", 1)[-1].strip() for l in lines if l.strip())
rows.append((tsv.stem, text, text))
with open("dataset/metadata.csv", "w", encoding="utf-8", newline="") as f:
csv.writer(f, delimiter="|").writerows(rows)
print(f"wrote {len(rows)} rows")Validate before burning GPU time — this script also produces the error text used in Troubleshooting:
# check_dataset.py — run: python check_dataset.py dataset/wavs dataset/metadata.csv
import csv, sys, wave
from pathlib import Path
wavs, meta = Path(sys.argv[1]), Path(sys.argv[2])
bad = 0
for i, row in enumerate(csv.reader(meta.open(encoding="utf-8"), delimiter="|"), 1):
if not row or not row[0].strip():
continue
f = wavs / f"{row[0]}.wav"
if not f.exists():
print(f"ERROR: metadata.csv line {i}: audio file {f} not found")
bad += 1
continue
with wave.open(str(f)) as w:
dur = w.getnframes() / w.getframerate()
if dur < 2 or dur > 15:
print(f"WARN: {f.name} duration {dur:.2f}s outside 2-15s")
sys.exit(1 if bad else 0)Training config (rename keys to match your toolkit's schema — schemas differ between releases, so check the documentation):
# configs/finetune_voice.yaml
dataset:
meta_file: dataset/metadata.csv
wav_dir: dataset/wavs
audio:
sample_rate: 22050
mono: true
train:
batch_size: 8
epochs: 10
output_dir: models/family_voice_v1Start the run with your toolkit's training entry point (placeholder — substitute the real module/script name from its docs):
python -m <toolkit>.train --config configs/finetune_voice.yamlHow to check: during training the log must print decreasing loss values, and after it finishes the output directory must contain a checkpoint plus a config file:
ls -lh models/family_voice_v1
# config.json
# model.pth (name depends on the toolkit)
What to do: generate a test sentence from the checkpoint, then expose it as a local HTTP service on port 8080.
Why: a checkpoint is not a product. A small HTTP wrapper lets any script or app in your home network request speech without knowing the toolkit's Python API.
Smoke test through the toolkit CLI first:
tts --model_path models/family_voice_v1 \
--config_path models/family_voice_v1/config.json \
--text "Grandma, this recording is for the family archive." \
--out_path out/smoke.wavThen the service (loader class and argument names vary by toolkit — check the docs):
# server.py — run: uvicorn server:app --host 127.0.0.1 --port 8080
import uuid, pathlib
from fastapi import FastAPI
from fastapi.responses import FileResponse
from pydantic import BaseModel
from TTS.api import TTS
app = FastAPI()
tts = TTS(model_path="models/family_voice_v1",
config_path="models/family_voice_v1/config.json")
OUT = pathlib.Path("out"); OUT.mkdir(exist_ok=True)
class Req(BaseModel):
text: str
@app.post("/speak")
def speak(req: Req):
name = f"{uuid.uuid4().hex}.wav"
tts.tts_to_file(text=req.text, file_path=str(OUT / name))
return FileResponse(OUT / name, media_type="audio/wav")Install and start: pip install fastapi uvicorn, then uvicorn server:app --host 127.0.0.1 --port 8080.
How to check: POST a sentence and inspect the returned file:
curl -X POST http://127.0.0.1:8080/speak \
-H "Content-Type: application/json" \
-d '{"text":"We are recording this for the family archive."}' \
-o out/test.wav
file out/test.wav
# out/test.wav: RIFF (little-endian) data, WAVE audio, 16 bit, mono 22050 HzSuccess looks like a .wav of plausible length that keeps the speaker's timbre and accent. Compare it side by side with a source clip; if the output is intelligible but flat, the dataset was probably too small or too noisy — go back to Step 1. For more local-model runtime options, see Open-weight AI models: how to run them for free in 2026.
Problem. ffmpeg rejects the cleanup filter chain.
No such filter: 'loudnorm'sudo apt install --reinstall ffmpeg && ffmpeg -filters | grep loudnorm. On static builds, download a full build from the vendor's own page.Problem. Dataset validation fails before training starts.
ERROR: metadata.csv line 42: audio file dataset/wavs/tape_01_0031.wav not foundfile_id in metadata.csv does not match the actual .wav filename — typical after renaming clips by hand or mixing tape_01_0012.wav with the id tape01_0012.ls dataset/wavs | head then edit the line, or regenerate the manifest with python build_metadata.py. Re-run python check_dataset.py dataset/wavs dataset/metadata.csv until it exits with no ERROR lines.Problem. Training stops on the GPU.
RuntimeError: CUDA out of memory. (the allocation sizes that follow vary per run)batch_size in configs/finetune_voice.yaml (for example from 8 to 4 or 2), cut clips closer to a few seconds, and if your toolkit exposes gradient accumulation, raise it instead of the batch size. Confirm the flag name in the docs.You now have a cleaned dataset, a fine-tuned checkpoint, and a local voice service on port 8080. Next, version the dataset and config in git, then add a second speaker as a separate output directory so the two voices never contaminate each other's training data.
How much audio do I need to clone a voice?
It depends on the method: zero-shot cloning works from a short reference clip, while fine-tuning needs a larger transcribed dataset. Your toolkit documents its own minimum — check the documentation rather than guessing.
Can I run the whole pipeline without a GPU?
Cleaning and transcription run on CPU (Whisper is slower there), but training on CPU is impractical for most recipes. Size your card against the recipe's VRAM requirements before you start.
Why does the output sound like the recording, hiss included?
Because the model learned the noise as part of the voice. Re-clean the sources with afftdn and loudnorm, drop clips with music or overlapping speakers, and retrain.
Can I publish the generated audio online?
Only with the speaker's explicit permission, and be transparent that the voice is synthetic. Consent you collected for a private family archive does not automatically cover public distribution.
Status: practical guide. Some statements come from vendors; verify in your environment.
Time to complete: 2–4 hours of manual work (digitizing, cleaning, dataset assembly), plus unattended training time that depends on your GPU and dataset size. Difficulty: Intermediate — you need a terminal, Python virtual environments, and basic audio knowledge (sample rate, mono/stereo).
Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.
| Entity | Type | Role |
|---|---|---|
| как клонировать голос нейросетью | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| обучение tts модели на своем голосе | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| локальный синтез речи по записи | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| восстановление голоса из аудиоархива ии | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Windows | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Linux | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| macOS | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Python | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| OpenAI | компания | упоминается в заголовке, TL;DR или разделах гайда |
No independent confirmation is provided; source claims and editorial conclusions are separated below.
| Source | Type | Role |
|---|---|---|
| No external links | — | — |
Cite as: AI Release. Как клонировать голос из семейного архива: запись, обучение TTS-модели и локальный запуск. ai-release.org.