mlx-audio also does text-to-speech: it can read text aloud with models such as Kokoro, which supports several languages. This guide generates a spoken version of a short text on an Apple Silicon Mac and checks that the audio is clear and complete.
Before you start
- An Apple Silicon Mac (M1, M2, M3 or M4).
- Python 3.10 or newer, and pip.
- A short text to read aloud, under 200 words for a first test.
Install mlx-audio
Install the package with pip:
pip install mlx-audio
Generate speech from a short text
Run the text-to-speech command with the Kokoro model:
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text "Hello, this is a test of local text to speech on my Mac."
The model downloads on first use. The command writes an audio file: check the output path it prints.
Listen to the audio and check it
Play the audio file and listen to the whole thing. Check that every sentence is present, that no word is cut off at the end, and that the voice is clear enough to understand.
Worked example
Sample text: “Hello, this is a test of local text to speech on my Mac. The meeting starts at ten o’clock on Friday.” The audio should read both sentences in full, with “Friday” clear at the end. If the last word is cut off, the text was too long for one call: split it and generate it in two parts.
Expected result
UNTESTED in this guide: no audio was generated while writing it. The expected result is an audio file that reads both sentences in full, with clear speech and no cut-off words.
Limitations
Text-to-speech is not transcription: this guide makes audio from text, it does not turn audio into text. Each TTS model keeps its own licence, so check the model card before commercial use. mlx-audio needs an Apple Silicon Mac.
