C.W.K.
Stream
Lesson 01 of 07 · published

mlx-audio TTS — Speaking on Apple Silicon

~12 min · mlx-audio, tts, speech-synthesis

Level 0Curious
0 XP0/51 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Speaking on Apple Silicon

mlx-audio is the audio extension for MLX — text-to-speech, speech-to-text, and a few audio-conditioned utilities. It lives outside the core mlx-lm package; you install it separately. The text-to-speech side is what this lesson covers.

The tradeoff to understand up front: TTS quality is moving fast and the leading models change every few months. A code path that worked perfectly with the popular TTS model of six months ago may need a new model name today. The pattern (load model, synthesize, save) is stable; the specific model identifiers and their voice slots are not. Treat the model names below as 2026-05 snapshots.

Install + minimum loop

Two commands. pip install mlx-audio in your mlx env, then a Python snippet that loads a TTS model and synthesizes one sentence to a WAV file.

Latency expectations on Apple Silicon

For a small TTS model (Kokoro / Sesame / similar 100M-parameter class) on an M-class Mac, the wall-clock latency to synthesize a short sentence is typically a fraction of the audio's playback duration — i.e. faster than realtime. For longer text or larger models, you'll see latency scale with token count and model size, but you should still see better-than-realtime on M-Pro and up. If you're seeing slower-than-realtime, the most likely cause is the model not being optimized for MLX yet (or being run through a wrapper that doesn't take advantage of unified memory).

Voices and prompts

Most modern TTS models accept a voice parameter (selects from a discrete set of trained voices) and the text to synthesize. Some accept additional conditioning — emotion, speaking rate, pause control via SSML-style markers. Read the model card for the exact API; the wrapper around the raw model in mlx-audio usually surfaces the same controls but renames them to fit a common API.

What to remember from this lesson

The mental model: TTS in MLX is one more API surface that loads, runs, and emits — same shape as mlx-lm's generate, but the output is bytes of audio instead of a string. The specific best-of-class model will change; the loop won't.

Code

Install mlx-audio (one-time)·bash
# In your `mlx` conda env
conda activate mlx
pip install mlx-audio
Synthesize one sentence to WAV (sketch — exact model name as of 2026-05)·python
# mlx-audio's high-level API is moving; check `python -m mlx_audio --help`
# for current sub-commands, and the model card on Hugging Face for required params.
# Typical pattern:

from mlx_audio.tts.generate import generate_audio

generate_audio(
    text="Hello from MLX on Apple Silicon.",
    model_path="prince-canuma/Kokoro-82M",   # or whichever current TTS model you choose
    voice="af_heart",                          # voice slot from the model card
    file_prefix="hello_mlx",                   # writes hello_mlx.wav
)

# Output: a WAV file in the current directory.
# Wall-clock time is typically a fraction of the audio's playback length on
# an M-Pro or Ultra; older / lower-tier chips may be at or near realtime.

External links

Exercise

Install mlx-audio in your mlx env. Read the current README for the recommended TTS model identifier (it may have evolved past Kokoro by the time you read this). Synthesize three sentences with three different voice slots from the same model and listen to all three. Two sentences on which voice felt most natural and how the wall-clock latency compared to playback duration.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.