MLX-Audio
raw JSON → 0.4.3 verified Fri May 01 auth: no python
MLX-Audio enables inference of text-to-speech (TTS) and speech-to-speech (STS) models locally on Apple Silicon Macs using MLX. Current version 0.4.3, with active development and frequent releases.
pip install mlx-audio Common errors
error ImportError: cannot import name 'Audio' from 'mlx_audio.audio' ↓
cause Audio is a top-level class, not in mlx_audio.audio submodule.
fix
Use 'from mlx_audio import Audio'.
error ModuleNotFoundError: No module named 'soundfile' ↓
cause soundfile was removed in favor of miniaudio+ffmpeg in v0.3.0.
fix
Install ffmpeg and update code: audio = Audio('file.wav').
error OSError: [Errno 2] No such file or directory: 'ffmpeg' ↓
cause ffmpeg is required but not installed on the system.
fix
Install ffmpeg (e.g., brew install ffmpeg on macOS).
Warnings
breaking In v0.3.0, soundfile was replaced with miniaudio + ffmpeg. Audio format handling changed; ensure ffmpeg is installed. ↓
fix Install ffmpeg (e.g., brew install ffmpeg) and update any soundfile-dependent code.
gotcha TTS and STS classes are not directly importable from mlx_audio; they are in submodules. ↓
fix Use from mlx_audio.tts import TTS or from mlx_audio.sts import STS.
deprecated The old load() API was refactored in v0.3.0rc1; using it without the new pattern may fail. ↓
fix Check the docs for the updated load() signature; use Audio() directly.
breaking In v0.4.2, setuptools was pinned to <81 to avoid webrtcvad import error. If you have setuptools>=81, install may break. ↓
fix pip install 'setuptools<81' or use pinned dependencies from requirements.
Imports
- Audio wrong
from mlx_audio.audio import Audiocorrectfrom mlx_audio import Audio - TTS wrong
from mlx_audio import TTScorrectfrom mlx_audio.tts import TTS - STS wrong
from mlx_audio import STScorrectfrom mlx_audio.sts import STS
Quickstart
from mlx_audio import Audio
# Load and play an audio file
audio = Audio("path/to/audio.wav")
print(audio.shape)
audio.play()