Neywa-Labs%2Fmlx-audio-swift | Trendshift # MLX Audio Swift A modular Swift SDK for audio processing with MLX on Apple Silicon ![Platform](https://img.shields.io/badge/platform-macOS%2014%2B%20%7C%20iOS%2017%2B-lightgrey) ![Swift](https://img.shields.io/badge/Swift-5.9%2B-orange) ![License](https://img.shields.io/badge/license-MIT-blue) ## Architecture MLXAudio follows a modular design allowing you to import only what you need: - **MLXAudioCore**: Base types, protocols, and utilities - **MLXAudioCodecs**: Audio codec implementations (SNAC, Encodec, Vocos, Mimi, DACVAE, Descript DAC, Fish S1 DAC, S3TokenizerV2, MOSS Audio Tokenizer, Higgs Audio Tokenizer, Step-Audio-2 token-to-wav, MiMo Audio Tokenizer, Nemotron VoiceChat Codec) - **MLXAudioTTS**: Text-to-Speech models (Qwen3-TTS, Fish Audio S2 Pro, Soprano, Orpheus, Pocket TTS, and more). [Full TTS model list](#tts-models). - **MLXAudioSTT**: Speech-to-Text models (Whisper, Parakeet, Qwen3-ASR, Voxtral Mini, VibeVoice ASR, and more). [Full STT model list](#stt-models). - **MLXAudioVAD**: Voice Activity Detection & Speaker Diarization (Sortformer, SmartTurn, FSMN VAD, Silero VAD) - **MLXAudioSTS**: Speech-to-Speech models (LFM2.5-Audio, SAM-Audio, MossFormer2-SE, DeepFilterNet) - **MLXAudioUI**: SwiftUI components for audio interfaces ## Installation Add MLXAudio to your project using Swift Package Manager: ```swift dependencies: [ .package(url: "https://github.com/Neywa-Labs/mlx-audio-swift.git", branch: "main") ] // Import only what you need .product(name: "MLXAudioTTS", package: "mlx-audio-swift"), .product(name: "MLXAudioCore", package: "mlx-audio-swift") ``` ## Quick Start ### Text-to-Speech ```swift import MLXAudioTTS import MLXAudioCore // Load a TTS model from HuggingFace let model = try await SopranoModel.fromPretrained("mlx-community/Soprano-80M-bf16") // Generate audio let audio = try await model.generate( text: "Hello from MLX Audio Swift!", parameters: GenerateParameters( maxTokens: 200, temperature: 0.7, topP: 0.95 ) ) // Save to file try saveAudioArray(audio, sampleRate: Double(model.sampleRate), to: outputURL) ``` ### Speech-to-Text ```swift import MLXAudioSTT import MLXAudioCore // Load audio file let (sampleRate, audioData) = try loadAudioArray(from: audioURL) // Load STT model let model = try await GLMASRModel.fromPretrained("mlx-community/GLM-ASR-Nano-2512-4bit") // Transcribe let output = model.generate(audio: audioData) print(output.text) ``` ### Speaker Diarization ```swift import MLXAudioVAD import MLXAudioCore // Load audio file let (sampleRate, audioData) = try loadAudioArray(from: audioURL) // Load diarization model let model = try await SortformerModel.fromPretrained( "mlx-community/diar_streaming_sortformer_4spk-v2.1-fp16" ) // Detect who is speaking when let output = try await model.generate(audio: audioData, threshold: 0.5) for segment in output.segments { print("Speaker \(segment.speaker): \(segment.start)s - \(segment.end)s") } ``` ### Streaming Generation ```swift for try await event in model.generateStream(text: text, parameters: parameters) { switch event { case .token(let token): print("Generated token: \(token)") case .audio(let audio): print("Final audio shape: \(audio.shape)") case .info(let info): print(info.summary) } } ``` ## Supported Models ### TTS Models | Model | Model README | HuggingFace Repo | |-------|--------------|------------------| | VibeVoice TTS | [VibeVoice TTS README](Sources/MLXAudioTTS/Models/VibeVoiceTTS/README.md) | [microsoft/VibeVoice-1.5B](https://huggingface.co/microsoft/VibeVoice-1.5B) | | Voxtral TTS | [Voxtral TTS README](Sources/MLXAudioTTS/Models/VoxtralTTS/README.md) | [mlx-community/Voxtral-4B-TTS-2603-mlx-4bit](https://huggingface.co/mlx-community/Voxtral-4B-TTS-2603-mlx-4bit), [BF16](https://huggingface.co/mlx-community/Voxtral-4B-TTS-2603-mlx-bf16) | | Maya-2 Native | [Maya-2 README](Sources/MLXAudioTTS/Models/Maya2/README.md) | [maya-research/maya2-native](https://huggingface.co/maya-research/maya2-native) | | MeloTTS English | [MeloTTS README](Sources/MLXAudioTTS/Models/MeloTTS/README.md) | [mlx-community/MeloTTS-English-MLX](https://huggingface.co/mlx-community/MeloTTS-English-MLX) | | Ming-3.0 TTS Tiny | [Ming Tiny README](Sources/MLXAudioTTS/Models/MingTiny/README.md) | [mlx-community/Ming-3.0-tts-tiny-4bit](https://huggingface.co/mlx-community/Ming-3.0-tts-tiny-4bit) | | Ming dense TTS | [Ming dense README](Sources/MLXAudioTTS/Models/Ming/README.md) | [mlx-community/Ming-3.0-tts-0.5B-bf16](https://huggingface.co/mlx-community/Ming-3.0-tts-0.5B-bf16), [inclusionAI/Ming-omni-tts-0.5B](https://huggingface.co/inclusionAI/Ming-omni-tts-0.5B) | | Ming Omni 16.8B/A3B | [Ming Omni README](Sources/MLXAudioTTS/Models/MingOmni/README.md) | [mlx-community/Ming-omni-tts-16.8B-A3B-4bit](https://huggingface.co/mlx-community/Ming-omni-tts-16.8B-A3B-4bit) | | KugelAudio | [KugelAudio README](Sources/MLXAudioTTS/Models/KugelAudio/README.md) | [kugelaudio/kugelaudio-0-open](https://huggingface.co/kugelaudio/kugelaudio-0-open) | | Bark Small | [Bark README](Sources/MLXAudioTTS/Models/Bark/README.md) | [mlx-community/bark-small](https://huggingface.co/mlx-community/bark-small) | | Confucius4-TTS | [Confucius4 README](Sources/MLXAudioTTS/Models/Confucius4/README.md) | [mlx-community/Confucius4-TTS-mlx-int8](https://huggingface.co/mlx-community/Confucius4-TTS-mlx-int8) | | Higgs Audio v2 TTS | [Higgs Audio v2 README](Sources/MLXAudioTTS/Models/HiggsAudioV2/README.md) | [mlx-community/higgs-audio-v2-3B-mlx-q8](https://huggingface.co/mlx-community/higgs-audio-v2-3B-mlx-q8), [q6](https://huggingface.co/mlx-community/higgs-audio-v2-3B-mlx-q6) | | Higgs Audio v3 TTS | [Higgs Audio v3 TTS README](Sources/MLXAudioTTS/Models/HiggsAudio3TTS/README.md) | [bosonai/higgs-tts-3-4b](https://huggingface.co/bosonai/higgs-tts-3-4b) | | Breeze TTS 2 | [Breeze TTS 2 README](Sources/MLXAudioTTS/Models/BreezeTTS/README.md) | [mlx-community/Breeze-TTS-2-mlx-4bit](https://huggingface.co/mlx-community/Breeze-TTS-2-mlx-4bit) | | Qwen3-TTS | [Qwen3-TTS README](Sources/MLXAudioTTS/Models/Qwen3TTS/README.md) | [mlx-community/Qwen3-TTS-12Hz-0.6B-Base-8bit](https://huggingface.co/mlx-community/Qwen3-TTS-12Hz-0.6B-Base-8bit) | | OuteTTS | [OuteTTS README](Sources/MLXAudioTTS/Models/OuteTTS/README.md) | [mlx-community/OuteTTS-1.0-0.6B-fp16](https://huggingface.co/mlx-community/OuteTTS-1.0-0.6B-fp16) | | OmniVoice | [OmniVoice README](Sources/MLXAudioTTS/Models/OmniVoice/README.md) | [mlx-community/OmniVoice](https://huggingface.co/mlx-community/OmniVoice) | | Audio8 0.1B / 0.6B | [Audio8 README](Sources/MLXAudioTTS/Models/Audio8/README.md) | [mlx-community/Audio8-TTS-Preview-0.1b-bf16](https://huggingface.co/mlx-community/Audio8-TTS-Preview-0.1b-bf16), [mlx-community/Audio8-TTS-Preview-0.6b-bf16](https://huggingface.co/mlx-community/Audio8-TTS-Preview-0.6b-bf16), [nativ-community/Audio8-TTS-Realistic-0.6b-bf16](https://huggingface.co/nativ-community/Audio8-TTS-Realistic-0.6b-bf16), [4-bit](https://huggingface.co/nativ-community/Audio8-TTS-Realistic-0.6b-4bit), [8-bit](https://huggingface.co/nativ-community/Audio8-TTS-Realistic-0.6b-8bit) | | Fish Audio S2 Pro | [Fish Audio S2 Pro README](Sources/MLXAudioTTS/Models/FishSpeech/README.md) | [mlx-community/fish-audio-s2-pro-8bit](https://huggingface.co/mlx-community/fish-audio-s2-pro-8bit) | | Soprano | [Soprano README](Sources/MLXAudioTTS/Models/Soprano/README.md) | [mlx-community/Soprano-80M-bf16](https://huggingface.co/mlx-community/Soprano-80M-bf16) | | TADA 1B / 3B | [TADA README](Sources/MLXAudioTTS/Models/TADA/README.md) | [HumeAI/mlx-tada-1b](https://huggingface.co/HumeAI/mlx-tada-1b), [3B](https://huggingface.co/HumeAI/mlx-tada-3b) | | VibeVoice Realtime | [VibeVoice Realtime README](Sources/MLXAudioTTS/Models/VibeVoice/README.md) | [mlx-community/VibeVoice-Realtime-0.5B-8bit](https://huggingface.co/mlx-community/VibeVoice-Realtime-0.5B-8bit) | | VoxCPM 1 / 1.5 | [VoxCPM README](Sources/MLXAudioTTS/Models/VoxCPM/README.md) | [mlx-community/VoxCPM1.5-4bit](https://huggingface.co/mlx-community/VoxCPM1.5-4bit), [fp16](https://huggingface.co/mlx-community/VoxCPM1.5-fp16), [8-bit](https://huggingface.co/mlx-community/VoxCPM1.5-8bit) | | ZONOS2 | [ZONOS2 README](Sources/MLXAudioTTS/Models/Zonos2/README.md) | [amal-david/Zyphra-ZONOS2-4bit](https://huggingface.co/amal-david/Zyphra-ZONOS2-4bit) | | ZONOS3-Mini | [ZONOS3 README](Sources/MLXAudioTTS/Models/Zonos3/README.md) | [mlx-community/ZONOS3-Mini](https://huggingface.co/mlx-community/ZONOS3-Mini) | | VyvoTTS | [VyvoTTS README](Sources/MLXAudioTTS/Models/Qwen3/README.md) | [mlx-community/VyvoTTS-EN-Beta-4bit](https://huggingface.co/mlx-community/VyvoTTS-EN-Beta-4bit) | | Orpheus | [Orpheus README](Sources/MLXAudioTTS/Models/Llama/README.md) | [mlx-community/orpheus-3b-0.1-ft-bf16](https://huggingface.co/mlx-community/orpheus-3b-0.1-ft-bf16) | | LongCat-AudioDiT | [LongCat README](Sources/MLXAudioTTS/Models/LongCatAudioDiT/README.md) | [mlx-community/LongCat-AudioDiT-1B-bf16](https://huggingface.co/mlx-community/LongCat-AudioDiT-1B-bf16), [4-bit](https://huggingface.co/mlx-community/LongCat-AudioDiT-1B-4bit), [MXFP4](https://huggingface.co/mlx-community/LongCat-AudioDiT-1B-mxfp4) | | Stable Audio 3 small (text-to-audio) | [Stable Audio 3 README](Sources/MLXAudioTTS/Models/StableAudio3/README.md) | [mlx-community/stable-audio-3-small-sfx](https://huggingface.co/mlx-community/stable-audio-3-small-sfx), [mlx-community/stable-audio-3-small-music](https://huggingface.co/mlx-community/stable-audio-3-small-music) | | Stable Audio 3 medium (text-to-audio) | [Stable Audio 3 README](Sources/MLXAudioTTS/Models/StableAudio3/README.md) | [mlx-community/stable-audio-3-medium](https://huggingface.co/mlx-community/stable-audio-3-medium) | | MOSS-TTS | [MOSS-TTS README](Sources/MLXAudioTTS/Models/MossTTS/README.md) | [OpenMOSS-Team/MOSS-TTS](https://huggingface.co/OpenMOSS-Team/MOSS-TTS), [OpenMOSS-Team/MOSS-TTSD-v1.0](https://huggingface.co/OpenMOSS-Team/MOSS-TTSD-v1.0), [OpenMOSS-Team/MOSS-TTS-Local-Transformer](https://huggingface.co/OpenMOSS-Team/MOSS-TTS-Local-Transformer) | | IndexTTS | — | [mlx-community/IndexTTS](https://huggingface.co/mlx-community/IndexTTS), [mlx-community/IndexTTS-1.5](https://huggingface.co/mlx-community/IndexTTS-1.5) | | Marvis TTS | [Marvis TTS README](Sources/MLXAudioTTS/Models/Marvis/README.md) | [Marvis-AI/marvis-tts-250m-v0.2-MLX-8bit](https://huggingface.co/Marvis-AI/marvis-tts-250m-v0.2-MLX-8bit) | | Pocket TTS | [Pocket TTS README](Sources/MLXAudioTTS/Models/PocketTTS/README.md) | [mlx-community/pocket-tts](https://huggingface.co/mlx-community/pocket-tts) | | Phonon | [Phonon README](Sources/MLXAudioTTS/Models/PocketTTS/README.md) | [Gradium 31M](https://huggingface.co/gradium/phonon-31m-en), [Gradium 40M](https://huggingface.co/gradium/phonon-40m-en) | | Irodori TTS | [Irodori TTS README](Sources/MLXAudioTTS/Models/IrodoriTTS/README.md) | [mlx-community/Irodori-TTS-600M-v3-VoiceDesign-8bit](https://huggingface.co/mlx-community/Irodori-TTS-600M-v3-VoiceDesign-8bit), [mlx-community/Irodori-TTS-v4.1-Small-8bit](https://huggingface.co/mlx-community/Irodori-TTS-v4.1-Small-8bit), [mlx-community/Irodori-TTS-v4.1-Small-MF-8bit](https://huggingface.co/mlx-community/Irodori-TTS-v4.1-Small-MF-8bit) | | Spark-TTS | [Spark-TTS README](Sources/MLXAudioTTS/Models/Spark/README.md) | [mlx-community/Spark-TTS-0.5B-bf16](https://huggingface.co/mlx-community/Spark-TTS-0.5B-bf16) | | rumik-oss 1 | [Rumik README](Sources/MLXAudioTTS/Models/Rumik/README.md) | [rumik-ai/rumik-oss-1-mlx-8bit](https://huggingface.co/rumik-ai/rumik-oss-1-mlx-8bit), [4-bit](https://huggingface.co/rumik-ai/rumik-oss-1-mlx-4bit), [BF16](https://huggingface.co/rumik-ai/rumik-oss-1) | | Dia | [Dia README](Sources/MLXAudioTTS/Models/Dia/README.md) | [mlx-community/Dia-1.6B](https://huggingface.co/mlx-community/Dia-1.6B) | ### STT Models | Model | Model README | HuggingFace Repo | |-------|--------------|------------------| | Higgs-Audio v3 STT | [Higgs-Audio STT README](Sources/MLXAudioSTT/Models/HiggsAudio3/README.md) | [bosonai/higgs-audio-v3-stt](https://huggingface.co/bosonai/higgs-audio-v3-stt) | | Mega-ASR | [Mega-ASR README](Sources/MLXAudioSTT/Models/MegaASR/README.md) | [mlx-community/Mega-ASR-bf16](https://huggingface.co/mlx-community/Mega-ASR-bf16) | | Qwen2-Audio | [Qwen2-Audio README](Sources/MLXAudioSTT/Models/Qwen2Audio/README.md) | [mlx-community/Qwen2-Audio-7B-Instruct-4bit](https://huggingface.co/mlx-community/Qwen2-Audio-7B-Instruct-4bit) | | Qwen3-ASR | [Qwen3-ASR README](Sources/MLXAudioSTT/Models/Qwen3ASR/README.md) | [mlx-community/Qwen3-ASR-1.7B-bf16](https://huggingface.co/mlx-community/Qwen3-ASR-1.7B-bf16) | | Qwen3-ForcedAligner | [Qwen3-ASR README](Sources/MLXAudioSTT/Models/Qwen3ASR/README.md) | [mlx-community/Qwen3-ForcedAligner-0.6B-bf16](https://huggingface.co/mlx-community/Qwen3-ForcedAligner-0.6B-bf16) | | MOSS-Music | [MOSS-Music README](Sources/MLXAudioSTT/Models/MossMusic/README.md) | [mlx-community/MOSS-Music-8B-Thinking-4bit](https://huggingface.co/mlx-community/MOSS-Music-8B-Thinking-4bit) | | MOSS-Transcribe-Diarize | [MOSS-Transcribe-Diarize README](Sources/MLXAudioSTT/Models/MossTranscribeDiarize/README.md) | [OpenMOSS-Team/MOSS-Transcribe-Diarize](https://huggingface.co/OpenMOSS-Team/MOSS-Transcribe-Diarize) | | Ming-3.0 ASR Tiny | [Ming ASR README](Sources/MLXAudioSTT/Models/MingASR/README.md) | [mlx-community/Ming-3.0-asr-tiny-4bit](https://huggingface.co/mlx-community/Ming-3.0-asr-tiny-4bit) | | MiMo-V2.5-ASR | [MiMo ASR README](Sources/MLXAudioSTT/Models/MiMoASR/README.md) | [mlx-community/MiMo-V2.5-ASR-MLX](https://huggingface.co/mlx-community/MiMo-V2.5-ASR-MLX) | | VibeVoice ASR | [VibeVoice ASR README](Sources/MLXAudioSTT/Models/VibeVoiceASR/README.md) | [microsoft/VibeVoice-ASR-Streaming-1.5B](https://huggingface.co/microsoft/VibeVoice-ASR-Streaming-1.5B) | | Voxtral Mini | [Voxtral Mini README](Sources/MLXAudioSTT/Models/Voxtral/README.md) | [mlx-community/Voxtral-Mini-3B-2507-bf16](https://huggingface.co/mlx-community/Voxtral-Mini-3B-2507-bf16) | | Voxtral Realtime | [Voxtral README](Sources/MLXAudioSTT/Models/VoxtralRealtime/README.md) | [mlx-community/Voxtral-Mini-4B-Realtime-2602-fp16](https://huggingface.co/mlx-community/Voxtral-Mini-4B-Realtime-2602-fp16) | | Cohere Transcribe | [Cohere Transcribe README](Sources/MLXAudioSTT/Models/CohereTranscribe/README.md) | [beshkenadze/cohere-transcribe-03-2026-mlx-fp16](https://huggingface.co/beshkenadze/cohere-transcribe-03-2026-mlx-fp16) | | Parakeet | [Parakeet README](Sources/MLXAudioSTT/Models/Parakeet/README.md) | [mlx-community/parakeet-tdt-0.6b-v3](https://huggingface.co/mlx-community/parakeet-tdt-0.6b-v3) | | Parakeet Redux | [Parakeet README](Sources/MLXAudioSTT/Models/Parakeet/README.md) | [moondream/parakeet-redux](https://huggingface.co/moondream/parakeet-redux) | | Parakeet Ultra | [Parakeet README](Sources/MLXAudioSTT/Models/Parakeet/README.md) | [moondream/parakeet-ultra](https://huggingface.co/moondream/parakeet-ultra) | | Orukeet | [Parakeet README](Sources/MLXAudioSTT/Models/Parakeet/README.md) | [oruk/orukeet](https://huggingface.co/oruk/orukeet) | | Phonon-2 / 2.5 | [Phonon README](Sources/MLXAudioSTT/Models/Phonon2/README.md) | [Phonon-2.5](https://huggingface.co/FermionResearch/Phonon-2.5), [Phonon-2.5-English](https://huggingface.co/FermionResearch/Phonon-2.5-English), [Phonon-2](https://huggingface.co/mlx-community/Phonon-2) | | Nemotron ASR | [Nemotron ASR README](Sources/MLXAudioSTT/Models/NemotronASR/README.md) | [Nemotron Speech Streaming](https://huggingface.co/animaslabs/nemotron-speech-streaming-en-0.6b-mlx-8bit), [Nemotron 3.5 ASR](https://huggingface.co/mlx-community/nemotron-3.5-asr-streaming-0.6b-8bit), [Nemotron Unified ASR](https://huggingface.co/mlx-community/nemotron-labs-unified-asr-0.6b-8bit) | | Nemotron 3.5 Transcribe | [Nemotron Transcribe README](Sources/MLXAudioSTT/Models/NemotronTranscribe/README.md) | [nvidia/NVIDIA-Nemotron-3.5-Transcribe-30B-A4B](https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Transcribe-30B-A4B), [MLX 4-bit](https://huggingface.co/nativ-community/Nemotron-3.5-Transcribe-30B-A4B-EA-4bit) | | SOV-Transcribe-1 | [SOV-Transcribe README](Sources/MLXAudioSTT/Models/SOVTranscribe/README.md) | [salesforce-sovereign-intelligence/SOV-Transcribe-1](https://huggingface.co/salesforce-sovereign-intelligence/SOV-Transcribe-1), [MLX 4-bit](https://huggingface.co/nativ-community/SOV-Transcribe-1-4bit) | | GLMASR | [GLMASR README](Sources/MLXAudioSTT/Models/GLMASR/README.md) | [mlx-community/GLM-ASR-Nano-2512-4bit](https://huggingface.co/mlx-community/GLM-ASR-Nano-2512-4bit) | | FireRedASR2 | [FireRedASR2 README](Sources/MLXAudioSTT/Models/FireRedASR2/README.md) | Converted FireRedASR2-compatible MLX checkpoints | | SenseVoice | [SenseVoice README](Sources/MLXAudioSTT/Models/SenseVoice/README.md) | Converted SenseVoice-compatible MLX checkpoints | | Fun-ASR-Nano | [Fun-ASR-Nano README](Sources/MLXAudioSTT/Models/FunASRNano/README.md) | [mlx-community/Fun-ASR-Nano-2512](https://huggingface.co/mlx-community/Fun-ASR-Nano-2512) | | Granite Speech | [Granite Speech README](Sources/MLXAudioSTT/Models/GraniteSpeech/README.md) | `ibm-granite/granite-speech-5.0-2b`, `ibm-granite/granite-speech-4.1-2b`, `ibm-granite/granite-speech-4.1-2b-plus` | | Granite Speech NAR | [Granite Speech NAR README](Sources/MLXAudioSTT/Models/GraniteSpeechNAR/README.md) | `ibm-granite/granite-speech-4.1-2b-nar` | | Granite Speech 5.0 TurboCTC | [TurboCTC README](Sources/MLXAudioSTT/Models/GraniteSpeech5CTC/README.md) | `ibm-granite/granite-speech-5.0-470m-turboctc` | | Whisper | [Whisper README](Sources/MLXAudioSTT/Models/Whisper/README.md) | [openai/whisper-large-v3-turbo](https://huggingface.co/openai/whisper-large-v3-turbo), [mlx-community/whisper-large-v3-turbo](https://huggingface.co/mlx-community/whisper-large-v3-turbo), and every other [openai/whisper-\*](https://huggingface.co/openai) / [mlx-community/whisper-\*](https://huggingface.co/mlx-community) size and `.en` variant | | Canary | — | [Mediform/canary-1b-v2-mlx-q8](https://huggingface.co/Mediform/canary-1b-v2-mlx-q8), Canary-compatible MLX/NeMo checkpoints | | Moonshine | — | [UsefulSensors/moonshine-tiny](https://huggingface.co/UsefulSensors/moonshine-tiny), Moonshine-compatible MLX checkpoints | | Wav2Vec2 CTC | — | [facebook/wav2vec2-base-960h](https://huggingface.co/facebook/wav2vec2-base-960h), Wav2Vec2 CTC-compatible checkpoints | | MMS | — | [facebook/mms-1b-fl102](https://huggingface.co/facebook/mms-1b-fl102), MMS adapter checkpoints | ### Audio Codecs | Codec | Notes | HuggingFace Repo | |-------|-------|------------------| | SNAC | Neural audio codec with encode/decode support | [mlx-community/snac_24khz](https://huggingface.co/mlx-community/snac_24khz) | | Encodec | Encodec-compatible audio codec runtime | Converted Encodec-compatible MLX checkpoints | | Vocos | Vocoder/codec decode components | Converted Vocos-compatible MLX checkpoints | | Mimi | Mimi encoder/decoder codec used by speech models | Mimi-compatible MLX checkpoints | | DACVAE | DAC-style VAE audio codec | Converted DACVAE-compatible MLX checkpoints | | Descript DAC | Descript DAC-compatible audio codec | Descript DAC-compatible checkpoints | | Fish S1 DAC | Fish Speech S1 audio codec | Fish S1 DAC-compatible checkpoints | | S3TokenizerV2 | S3 acoustic tokenizer exposed in `MLXAudioCodecs` | [mlx-community/S3TokenizerV2](https://huggingface.co/mlx-community/S3TokenizerV2) | | MiMo Audio Tokenizer | Offline 24 kHz encoder/decoder with 20 RVQ codebooks | [XiaomiMiMo/MiMo-Audio-Tokenizer](https://huggingface.co/XiaomiMiMo/MiMo-Audio-Tokenizer) | | Nemotron VoiceChat Codec | 22.05 kHz codec with offline encoding and incremental decoding | [mlx-community/NemotronLabs-VoiceChat-11B-4bit](https://huggingface.co/mlx-community/NemotronLabs-VoiceChat-11B-4bit) | | MOSS Audio Tokenizer | MOSS audio tokenizer runtime shared with MOSS TTS models | [mlx-community/MOSS-Audio-Tokenizer-Nano](https://huggingface.co/mlx-community/MOSS-Audio-Tokenizer-Nano) | | Higgs Audio Tokenizer | Higgs acoustic tokenizer decode and acoustic encode support | [bosonai/higgs-audio-v3-tts-4b](https://huggingface.co/bosonai/higgs-audio-v3-tts-4b) bundled tokenizer weights | | Step-Audio-2 Token2Wav | Token-to-waveform stack for Step-Audio-2 style prompts | [mlx-community/Step-Audio-2-token2wav](https://huggingface.co/mlx-community/Step-Audio-2-token2wav) | ### STS Models | Model | Model README | HuggingFace Repo | |-------|--------------|------------------| | LFM2.5-Audio | [LFM Audio README](Sources/MLXAudioSTS/Models/LFMAudio/README.md) | [mlx-community/LFM2.5-Audio-1.5B-6bit](https://huggingface.co/mlx-community/LFM2.5-Audio-1.5B-6bit) | | SAM-Audio | [SAM Audio README](Sources/MLXAudioSTS/Models/SAMAudio/README.md) | [mlx-community/sam-audio-large-fp16](https://huggingface.co/mlx-community/sam-audio-large-fp16) | | MossFormer2-SE | — | [starkdmi/MossFormer2-SE-fp16](https://huggingface.co/starkdmi/MossFormer2-SE-fp16) | | DeepFilterNet | [DeepFilterNet README](Sources/MLXAudioSTS/Models/DeepFilterNet/README.md) | [mlx-community/DeepFilterNet-mlx](https://huggingface.co/mlx-community/DeepFilterNet-mlx) | ### VAD / Speaker Diarization Models | Model | Model README | HuggingFace Repo | |-------|--------------|------------------| | Sortformer | [Sortformer README](Sources/MLXAudioVAD/Models/Sortformer/README.md) | [mlx-community/diar_streaming_sortformer_4spk-v2.1-fp16](https://huggingface.co/mlx-community/diar_streaming_sortformer_4spk-v2.1-fp16) | | SmartTurn | [SmartTurn README](Sources/MLXAudioVAD/Models/SmartTurn/README.md) | [mlx-community/smart-turn-v3](https://huggingface.co/mlx-community/smart-turn-v3) | | FSMN VAD | — | [mlx-community/fsmn-vad](https://huggingface.co/mlx-community/fsmn-vad) | | Silero VAD | [Silero VAD README](Sources/MLXAudioVAD/Models/SileroVAD/README.md) | Silero VAD-compatible MLX checkpoints | ## Features - **Modular architecture** for minimal app size - import only what you need - **Automatic model downloading** from HuggingFace Hub - **Native async/await support** for seamless Swift integration - **Streaming audio generation** for real-time TTS - **Type-safe Swift API** with comprehensive error handling - **Optimized for Apple Silicon** with MLX framework ## Advanced Usage ### Custom Generation Parameters ```swift let parameters = GenerateParameters( maxTokens: 1200, temperature: 0.7, topP: 0.95, repetitionPenalty: 1.5, repetitionContextSize: 30 ) let audio = try await model.generate(text: "Your text here", parameters: parameters) ``` ### Audio Codec Usage ```swift import MLXAudioCodecs // Load SNAC codec let snac = try await SNAC.fromPretrained("mlx-community/snac_24khz") // Encode audio to tokens let tokens = try snac.encode(audio) // Decode tokens back to audio let reconstructed = try snac.decode(tokens) ``` ### Voice Selection for Multi-Voice Models ```swift // For models supporting multiple voices (like LlamaTTS/Orpheus) let audio = try await model.generate( text: "Hello!", voice: "tara", // Options: tara, leah, jess, leo, dan, mia, zac, zoe parameters: parameters ) ``` ## Requirements - **macOS 14+** or **iOS 17+** - **Apple Silicon** (M1 or later) recommended for optimal performance - **Xcode 15+** - **Swift 5.9+** ## Examples [Phonon Translate](Examples/PhononTranslate) is an XcodeGen example for iOS and macOS: type in English, translate into French with a small local language model, and listen with Phonon’s English and French voices. Check out the [Examples/VoicesApp](Examples/VoicesApp) directory for a complete SwiftUI application demonstrating: - Loading and running TTS models - Playing generated audio - UI components for model interaction Additional usage examples can be found in the test files. ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines. ## Credits - Built on [MLX Swift](https://github.com/ml-explore/mlx-swift) - Uses [swift-transformers](https://github.com/huggingface/swift-transformers) - Inspired by [MLX Audio (Python)](https://github.com/Blaizzy/mlx-audio) ## License MIT License - see [LICENSE](LICENSE) file for details.