#!/bin/sh # Old Tam's voice (tools/voice/make_voice.py). Run after changing any line in # data/tutorial.json or data/hints.json: # # tools/voice/make_voice.sh # just the lines that changed # tools/voice/make_voice.sh --all # every line again # # 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-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" "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 "$@"