Old Tam rewritten and re-voiced (Gitea #3): a new script in his own voice, an old West Country farmer (Qwen3-TTS cloning one recording, so he's the same man in every line), each line's best take chosen by checking its words with Whisper

This commit is contained in:
Paul Bailey
2026-11-08 23:35:18 +00:00
parent 4a691b72e1
commit a3660f91cf
54 changed files with 220 additions and 173 deletions

View File

@@ -5,17 +5,18 @@
# tools/voice/make_voice.sh # just the lines that changed
# tools/voice/make_voice.sh --all # every line again
#
# The first run sets up a Python 3.12 environment for Kokoro in
# tools/voice/.venv (about 1 GB, with PyTorch; needs uv) and downloads the
# Kokoro model (about 330 MB) from Hugging Face.
# Needs an Apple-silicon Mac (MLX), ffmpeg and uv. The first run sets up a
# Python 3.12 environment in tools/voice/.venv-qwen and downloads the models
# from Hugging Face: Qwen3-TTS 1.7B Base (about 4 GB) and Whisper large-v3
# turbo (about 1.6 GB), to check what each take says.
cd "$(dirname "$0")/../.." || exit 1
V=tools/voice/.venv
V=tools/voice/.venv-qwen
command -v ffmpeg >/dev/null || { echo "needs ffmpeg (brew install ffmpeg)"; exit 1; }
if [ ! -x "$V/bin/python" ]; then
command -v uv >/dev/null || { echo "needs uv (https://docs.astral.sh/uv/)"; exit 1; }
uv venv -q --python 3.12 "$V" || exit 1
uv pip install -q --python "$V/bin/python" "kokoro==0.9.4" "misaki[en]==0.9.4" "soundfile==0.14.0" \
"en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl" || exit 1
uv pip install -q --python "$V/bin/python" "mlx-audio==0.6.4" "mlx==0.32.4" "mlx-whisper==0.4.3" \
"soundfile==0.13.1" "numpy==2.5.4" "transformers==5.22.2" || exit 1
fi
exec "$V/bin/python" tools/voice/make_voice.py "$@"