"""Text -> 24 kHz WAV with the Maya 2 MLX port. .venv/bin/python -I speak.py "Hello there." -o hello.wav [--lang en] [--voice Malini] [--seed 7] .venv/bin/python -I speak.py --voices # the named voices Same defaults as the official Maya3TTS.generate: plain voice, English, ~20 s pieces with 0.15 s gaps, no text normalisation unless --normalize, a fresh engine-wide seed per piece unless --seed. """ import argparse import os import sys import time import wave sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import numpy as np # noqa: E402 from maya2_mlx import Maya2 # noqa: E402 def write_wav(path, wav, sr=24000): pcm = np.rint(np.asarray(wav, np.float32) * np.float32(32767)).astype("