Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Blaizzy%2Fmlx-audio | Trendshift

MLX-Audio

The best audio processing library built on Apple's MLX framework, providing fast and efficient text-to-speech (TTS), speech-to-text (STT), and speech-to-speech (STS) on Apple Silicon.

Features

  • Fast inference optimized for Apple Silicon (M series chips)
  • Multiple model architectures for TTS, STT, and STS
  • Multilingual support across models
  • Voice customization and cloning capabilities
  • Adjustable speech speed control
  • Interactive web interface with 3D audio visualization
  • OpenAI-compatible REST API
  • Quantization support (3-bit, 4-bit, 6-bit, 8-bit, and more) for optimized performance
  • Swift package for iOS/macOS integration

Installation

Using pip

pip install mlx-audio

Using uv to install only the command line tools

Latest release from pypi:

uv tool install --force mlx-audio --prerelease=allow

Latest code from github:

uv tool install --force git+https://github.com/Blaizzy/mlx-audio.git --prerelease=allow

For development or web interface:

git clone https://github.com/Blaizzy/mlx-audio.git
cd mlx-audio
pip install -e ".[dev]"

Quick Start

Command Line

# Basic TTS generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello, world!' --lang_code a
# With voice selection and speed adjustment
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --voice af_heart --speed 1.2 --lang_code a
# Play audio immediately
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --play --lang_code a
# Save to a specific directory
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --output_path ./my_audio --lang_code a
# Stream audio during generation
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --lang_code a
# Stream audio during generation and save it to disk
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text 'Hello!' --stream --save --lang_code a
# Join multiple generated segments into one file
mlx_audio.tts.generate --model mlx-community/Kokoro-82M-bf16 --text $'Hello!\nHow are you?' --join_audio --lang_code a

By default, when generation yields multiple segments, mlx-audio saves numbered files such as audio_000.wav and audio_001.wav. Use --join_audio to save one combined file instead. When using --stream, add --save to write the streamed audio to disk.

Python API

frommlx_audio.tts.utilsimportload_model# Load modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate speechforresultinmodel.generate("Hello from MLX-Audio!", voice="af_heart"):
print(f"Generated {result.audio.shape[0]} samples")
# result.audio contains the waveform as mx.array

Supported Models

Text-to-Speech (TTS)

ModelDescriptionLanguagesRepo
KokoroFast, high-quality multilingual TTSEN, JA, ZH, FR, ES, IT, PT, HImlx-community/Kokoro-82M-bf16
Qwen3-TTSAlibaba's multilingual TTS with voice designZH, EN, JA, KO, + moremlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16
CSMConversational Speech Model with voice cloningENmlx-community/csm-1b
DiaDialogue-focused TTSENmlx-community/Dia-1.6B-fp16
OuteTTSEfficient TTS modelENmlx-community/OuteTTS-1.0-0.6B-fp16
SparkSparkTTS modelEN, ZHmlx-community/Spark-TTS-0.5B-bf16
ChatterboxExpressive multilingual TTSEN, ES, FR, DE, IT, PT, PL, TR, RU, NL, CS, AR, ZH, JA, HU, KOmlx-community/chatterbox-fp16
SopranoHigh-quality TTSENmlx-community/Soprano-1.1-80M-bf16
Ming Omni TTS (BailingMM)Multimodal generation with voice cloning, style control, and speech/music/event generationEN, ZHmlx-community/Ming-omni-tts-16.8B-A3B-bf16
Ming Omni TTS (Dense)Lightweight dense Ming Omni variant for voice cloning and style controlEN, ZHmlx-community/Ming-omni-tts-0.5B-bf16
KugelAudioSOTA 7B AR+Diffusion TTS for European languagesEN, DE, FR, ES, IT, PT, NL, PL, RU, UK, + 14 morekugelaudio/kugelaudio-0-open
Voxtral TTSMistral's 4B multilingual TTS (20 voices, 9 languages)EN, FR, ES, DE, IT, PT, NL, AR, HImlx-community/Voxtral-4B-TTS-2603-mlx-bf16
LongCat-AudioDiTSOTA diffusion TTS in waveform latent space with voice cloningZH, ENmlx-community/LongCat-AudioDiT-1B-bf16

Speech-to-Text (STT)

ModelDescriptionLanguagesRepo
WhisperOpenAI's robust STT model99+ languagesmlx-community/whisper-large-v3-turbo-asr-fp16
Distil-WhisperDistilled fast Whisper variantsENdistil-whisper/distil-large-v3
Qwen3-ASRAlibaba's multilingual ASRZH, EN, JA, KO, + moremlx-community/Qwen3-ASR-1.7B-8bit
Qwen3-ForcedAlignerWord-level audio alignmentZH, EN, JA, KO, + moremlx-community/Qwen3-ForcedAligner-0.6B-8bit
ParakeetNVIDIA's accurate STTEN (v2), 25 EU languages (v3)mlx-community/parakeet-tdt-0.6b-v3
VoxtralMistral's speech modelMultiplemlx-community/Voxtral-Mini-3B-2507-bf16
Voxtral RealtimeMistral's 4B streaming STTMultiple4bit, fp16
VibeVoice-ASRMicrosoft's 9B ASR with diarization & timestampsMultiplemlx-community/VibeVoice-ASR-bf16
CanaryNVIDIA's multilingual ASR with translation25 EU + RU, UKREADME
MoonshineUseful Sensors' lightweight ASRENREADME
MMSMeta's massively multilingual ASR with adapters1000+README
Granite SpeechIBM's ASR + speech translationEN, FR, DE, ES, PT, JAREADME
Qwen2-AudioAlibaba's multimodal audio understanding (ASR, captioning, emotion, translation)Multiplemlx-community/Qwen2-Audio-7B-Instruct-4bit

Voice Activity Detection / Speaker Diarization (VAD)

ModelDescriptionLanguagesRepo
Sortformer v1NVIDIA's end-to-end speaker diarization (up to 4 speakers)Language-agnosticmlx-community/diar_sortformer_4spk-v1-fp32
Sortformer v2.1NVIDIA's streaming speaker diarization with AOSC compressionLanguage-agnosticmlx-community/diar_streaming_sortformer_4spk-v2.1-fp32

See the Sortformer README for API details, streaming examples, and model conversion.

Speech-to-Speech (STS)

ModelDescriptionUse CaseRepo
SAM-AudioText-guided source separationExtract specific soundsmlx-community/sam-audio-large
Liquid2.5-Audio*Speech-to-Speech, Text-to-Speech and Speech-to-TextSpeech interactionsmlx-community/LFM2.5-Audio-1.5B-8bit
MossFormer2 SESpeech enhancementNoise removalstarkdmi/MossFormer2_SE_48K_MLX
DeepFilterNet (1/2/3)Speech enhancementNoise suppressionmlx-community/DeepFilterNet-mlx

Model Examples

Kokoro TTS

Kokoro is a fast, multilingual TTS model with 54 voice presets.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Kokoro-82M-bf16")
# Generate with different voicesforresultinmodel.generate(
text="Welcome to MLX-Audio!",
voice="af_heart", # American femalespeed=1.0,
lang_code="a"# American English
):
audio=result.audio

Available Voices:

  • American English: af_heart, af_bella, af_nova, af_sky, am_adam, am_echo, etc.
  • British English: bf_alice, bf_emma, bm_daniel, bm_george, etc.
  • Japanese: jf_alpha, jm_kumo, etc.
  • Chinese: zf_xiaobei, zm_yunxi, etc.

Language Codes:

CodeLanguageNote
aAmerican EnglishDefault
bBritish English
jJapaneseRequires pip install misaki[ja]
zMandarin ChineseRequires pip install misaki[zh]
eSpanish
fFrench

Qwen3-TTS

Alibaba's state-of-the-art multilingual TTS with voice cloning, emotion control, and voice design capabilities.

frommlx_audio.tts.utilsimportload_modelmodel=load_model("mlx-community/Qwen3-TTS-12Hz-0.6B-Base-bf16")
results=list(model.generate(
text="Hello, welcome to MLX-Audio!",
voice="Chelsie",
language="English",
))
audio=results[0].audio# mx.array

See the Qwen3-TTS README for voice cloning, CustomVoice, VoiceDesign, and all available models.

Ming Omni TTS (BailingMM)

mlx_audio.tts.generate \
--model mlx-community/Ming-omni-tts-16.8B-A3B-bf16 \
--prompt "Please generate speech based on the following description.\n" \
--text "This is a quick Ming Omni test." \
--lang_code en \
--output_path audio_io \
--file_prefix ming_basic \
--verbose

See the Ming Omni TTS README for CLI and Python cookbook examples, and the Ming Omni Dense README for the mlx-community/Ming-omni-tts-0.5B-bf16 workflow.

CSM (Voice Cloning)

Clone any voice using a reference audio sample:

mlx_audio.tts.generate \
--model mlx-community/csm-1b \
--text "Hello from Sesame." \
--ref_audio ./reference_voice.wav \
--play

Whisper STT

frommlx_audio.stt.generateimportgenerate_transcriptionresult=generate_transcription(
model="mlx-community/whisper-large-v3-turbo-asr-fp16",
audio="audio.wav",
)
print(result.text)

Qwen3-ASR & ForcedAligner

Alibaba's multilingual speech models for transcription and word-level alignment.

frommlx_audio.sttimportload# Speech recognitionmodel=load("mlx-community/Qwen3-ASR-0.6B-8bit")
result=model.generate("audio.wav", language="English")
print(result.text)
# Word-level forced alignmentaligner=load("mlx-community/Qwen3-ForcedAligner-0.6B-8bit")
result=aligner.generate("audio.wav", text="I have a dream", language="English")
foriteminresult:
print(f"[{item.start_time:.2f}s - {item.end_time:.2f}s] {item.text}")

See the Qwen3-ASR README for CLI usage, all models, and more examples.

VibeVoice-ASR

Microsoft's 9B parameter speech-to-text model with speaker diarization and timestamps. Supports long-form audio (up to 60 minutes) and outputs structured JSON.

frommlx_audio.stt.utilsimportloadmodel=load("mlx-community/VibeVoice-ASR-bf16")
# Basic transcriptionresult=model.generate(audio="meeting.wav", max_tokens=8192, temperature=0.0)
print(result.text)
# [{"Start":0,"End":5.2,"Speaker":0,"Content":"Hello everyone, let's begin."},# {"Start":5.5,"End":9.8,"Speaker":1,"Content":"Thanks for joining today."}]# Access parsed segmentsforseginresult.segments:
print(f"[{seg['start_time']:.1f}-{seg['end_time']:.1f}] Speaker {seg['speaker_id']}: {seg['text']}")

Streaming transcription:

# Stream tokens as they are generatedfortextinmodel.stream_transcribe(audio="speech.wav", max_tokens=4096):
print(text, end="", flush=True)

With context (hotwords/metadata):

result=model.generate(
audio="technical_talk.wav",
context="MLX, Apple Silicon, PyTorch, Transformer",
max_tokens=8192,
temperature=0.0,
)

CLI usage:

# Basic transcription
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio meeting.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--verbose
# With context/hotwords
python -m mlx_audio.stt.generate \
--model mlx-community/VibeVoice-ASR-bf16 \
--audio technical_talk.wav \
--output-path output \
--format json \
--max-tokens 8192 \
--context "MLX, Apple Silicon, PyTorch, Transformer" \
--verbose

Parakeet (Multilingual STT)

NVIDIA's high-accuracy speech-to-text model. Parakeet v3 supports 25 European languages.

frommlx_audio.stt.utilsimportload# Load the multilingual v3 modelmodel=load("mlx-community/parakeet-tdt-0.6b-v3")
# Transcribe audioresult=model.generate("audio.wav")
print(f"Text: {result.text}")
# Access word-level timestampsforsentenceinresult.sentences:
print(f"[{sentence.start:.2f}s - {sentence.end:.2f}s] {sentence.text}")

Streaming transcription:

forchunkinmodel.generate("long_audio.wav", stream=True):
print(chunk.text, end="", flush=True)

Supported languages (v3): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Russian, Ukrainian

CLI usage:

python -m mlx_audio.stt.generate \
--model mlx-community/parakeet-tdt-0.6b-v3 \
--audio speech.wav \
--output-path output \
--format json \
--verbose

KugelAudio

SOTA open-source 7B TTS model for 24 European languages, based on Microsoft VibeVoice. Uses a hybrid AR + Diffusion architecture (Qwen2.5 LM + SDE-DPM-Solver++ diffusion head + VAE decoder).

frommlx_audio.tts.utilsimportload_modelmodel=load_model("kugelaudio/kugelaudio-0-open")
forresultinmodel.generate(
text="Hello, welcome to MLX-Audio!",
cfg_scale=3.0, # Classifier-free guidance (1.0=fast, 3.0=quality)ddpm_steps=10, # Diffusion steps (5=fast, 10=balanced, 20=max quality)
):
audio=result.audio# mx.array, 24kHz

The model loads directly from HuggingFace (weights are remapped automatically via sanitize()). To quantize or save in a pre-converted format:

python -m mlx_audio.convert \
--hf-path kugelaudio/kugelaudio-0-open \
--mlx-path ./kugelaudio-0-open-bf16 \
--dtype bfloat16

Supported languages (24): English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Romanian, Hungarian, Swedish, Danish, Finnish, Norwegian, Greek, Bulgarian, Slovak, Croatian, Serbian, Turkish

Note: Requires ~17GB memory (7B params in bfloat16). Pre-encoded voice presets (voice cloning) are not yet available in the upstream model — the model generates speech with a default voice.

LongCat-AudioDiT

SOTA diffusion-based TTS operating in the waveform latent space. Uses Conditional Flow Matching with a DiT backbone and WAV-VAE codec at 24kHz. Supports zero-shot voice cloning.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/LongCat-AudioDiT-1B-bf16")
# Zero-shot TTSresult=next(model.generate("Hello, this is a test of AudioDiT."))
audio=result.audio# mx.array, 24kHz# Voice cloning (use "apg" guidance for best similarity)result=next(model.generate(
text="Today is warm turning to rain.",
ref_audio="reference.wav",
ref_text="Transcript of the reference audio.",
guidance_method="apg",
cfg_strength=4.0,
steps=16,
))

See the LongCat-AudioDiT README for all parameters and CLI usage.

Voxtral TTS

Mistral's 4B multilingual text-to-speech with 20 voice presets across 9 languages.

frommlx_audio.tts.utilsimportloadmodel=load("mlx-community/Voxtral-4B-TTS-2603-mlx-bf16")
forresultinmodel.generate(text="Hello, how are you today?", voice="casual_male"):
print(result.audio_duration)

Voices: casual_male, casual_female, cheerful_female, neutral_male, neutral_female, fr_male, fr_female, es_male, es_female, de_male, de_female, it_male, it_female, pt_male, pt_female, nl_male, nl_female, ar_male, hi_male, hi_female

Voxtral Realtime

Mistral's 4B parameter streaming speech-to-text model, optimized for low-latency transcription.

Available variants: 4bit (smaller/faster) | fp16 (full precision)

frommlx_audio.stt.utilsimportload# Use 4bit for faster inference, fp16 for full precisionmodel=load("mlx-community/Voxtral-Mini-4B-Realtime-2602-4bit")
# Transcribe audioresult=model.generate("audio.wav")
print(result.text)
# Streaming transcriptionforchunkinmodel.generate("audio.wav", stream=True):
print(chunk, end="", flush=True)
# Adjust transcription delay (lower = faster but less accurate)result=model.generate("audio.wav", transcription_delay_ms=240)

MedASR (Medical Transcription)

Specialized model for medical terms and dictation.

frommlx_audio.stt.utilsimportload, transcribemodel=load("mlx-community/medasr")
result=transcribe("medical_dictation.wav", model=model)
print(result["text"])

Live Transcription Example:

# Continuous live transcription with VAD
python examples/medasr_live.py

SAM-Audio (Source Separation)

Separate specific sounds from audio using text prompts:

frommlx_audio.stsimportSAMAudio, SAMAudioProcessor, save_audiomodel=SAMAudio.from_pretrained("mlx-community/sam-audio-large")
processor=SAMAudioProcessor.from_pretrained("mlx-community/sam-audio-large")
batch=processor(
descriptions=["A person speaking"],
audios=["mixed_audio.wav"],
)
result=model.separate_long(
batch.audios,
descriptions=batch.descriptions,
anchors=batch.anchor_ids,
chunk_seconds=10.0,
overlap_seconds=3.0,
ode_opt={"method": "midpoint", "step_size": 2/32},
)
save_audio(result.target[0], "voice.wav")
save_audio(result.residual[0], "background.wav")

MossFormer2 (Speech Enhancement)

Remove noise from speech recordings:

frommlx_audio.stsimportMossFormer2SEModel, save_audiomodel=MossFormer2SEModel.from_pretrained("starkdmi/MossFormer2_SE_48K_MLX")
enhanced=model.enhance("noisy_speech.wav")
save_audio(enhanced, "clean.wav", 48000)

Web Interface & API Server

MLX-Audio includes a modern web interface and OpenAI-compatible API.

Starting the Server

# Start API server
mlx_audio.server --host 0.0.0.0 --port 8000
# Start web UI (in another terminal)cd mlx_audio/ui
npm install && npm run dev

API Endpoints

Text-to-Speech (OpenAI-compatible):

curl -X POST http://localhost:8000/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "mlx-community/Kokoro-82M-bf16", "input": "Hello!", "voice": "af_heart"}' \
--output speech.wav

Speech-to-Text:

curl -X POST http://localhost:8000/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "model=mlx-community/whisper-large-v3-turbo-asr-fp16"

Quantization

Reduce model size and improve performance with quantization using the convert script:

# Convert and quantize to 4-bit
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-4bit \
--quantize \
--q-bits 4 \
--upload-repo username/Kokoro-82M-4bit (optional: if you want to upload the model to Hugging Face)
# Convert with MXFP4 quantization
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-mxfp4 \
--quantize \
--q-mode mxfp4
# Convert with specific dtype (bfloat16)
python -m mlx_audio.convert \
--hf-path prince-canuma/Kokoro-82M \
--mlx-path ./Kokoro-82M-bf16 \
--dtype bfloat16 \
--upload-repo username/Kokoro-82M-bf16 (optional: if you want to upload the model to Hugging Face)

Options:

FlagDescription
--hf-pathSource Hugging Face model or local path
--mlx-pathOutput directory for converted model
-q, --quantizeEnable quantization
--q-bitsBits per weight (optional, defaults depend on --q-mode)
--q-group-sizeGroup size for quantization (optional, defaults depend on --q-mode)
--q-modeQuantization mode: affine, mxfp4, mxfp8, nvfp4
--dtypeWeight dtype: float16, bfloat16, float32
--upload-repoUpload converted model to HF Hub

Swift

Looking for Swift/iOS support? Check out mlx-audio-swift for on-device TTS using MLX on macOS and iOS.

Requirements

  • Python 3.10+
  • Apple Silicon Mac (M1/M2/M3/M4)
  • MLX framework
  • ffmpeg (required for MP3/FLAC/OGG/Opus/Vorbis audio encoding)

Installing ffmpeg

ffmpeg is required for saving audio in MP3, FLAC, OGG, Opus, or Vorbis format. Install it using:

# macOS (using Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg

WAV format works without ffmpeg.

License

MIT License

Citation

@misc{mlx-audio,
author = {Canuma, Prince},
title = {MLX Audio},
year = {2025},
howpublished = {\url{https://github.com/Blaizzy/mlx-audio}},
note = {Audio processing library for Apple Silicon with TTS, STT, and STS capabilities.}
}

Acknowledgements

About

A text-to-speech (TTS), speech-to-text (STT) and speech-to-speech (STS) library built on Apple's MLX framework, providing efficient speech analysis on Apple Silicon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages