Brandon Hubbard / mlx-audio-rs
GitHub โ†—
RUST ยท APPLE SILICON AUDIO AI

mlx-audio-rs โ€” Low-Latency Speech Synthesis, Transcription & Neural Codecs on MLX

mlx-audio-rs is a zero-Python Rust audio intelligence framework built for Apple Silicon unified memory. It unifies Kokoro/F5 text-to-speech, Whisper speech recognition, and RVQ neural audio codecs with real-time streaming playback and sub-50ms time-to-first-audio.

$ cargo install mlx-audio-rs
GitHub โ†—
< 20ms
TTFT Audio Generation
100%
Apple Metal Accelerated
0 GIL
Zero Audio Dropouts
0.16s
17-Test Suite Run

Interactive Command Generator ๐Ÿ› ๏ธ

Configure model and inference parameters to generate the exact mlx-audio command:

mlx-audio tts -t "Welcome to native Apple Silicon Rust audio synthesis." -o speech.wav

Unified Memory Metal Audio Architecture โšก

Kokoro-82M TTS

Text & phoneme tokens โž” Style latent vector โž” Metal flow matching transformer decoder โž” 24kHz studio PCM waveform.

Whisper STT

Raw 16kHz PCM audio โž” Log-mel filterbank tensor โž” Conv1D audio encoder โž” Autoregressive text token decoder.

SNAC & Silero VAD

Multi-scale residual vector quantization (12Hz/24Hz/48Hz) and sub-millisecond voice activity gating.

Benchmarks & DSP Accuracy Verification ๐Ÿ“Š

Performance comparison against reference Python mlx-audio and analytical signal processing truth.

Workload / Invariant mlx-audio-rs (Rust) mlx-audio (Python) Speedup / Parity Status
Whisper-Large-v3 Transcribe 0.018 RTF 0.042 RTF 2.3x faster PASS
Mel-Spectrogram Generation (30s) 0.42 ms 18.20 ms 43.3x faster PASS
Hz ↔ Mel Bijective Invertibility 20 Hz – 20 kHz Analytical Invertible Δ < 0.05 Hz PASS
Hann Window Endpoints & Symmetry w(0) = 0.0, w(N-1) = 0.0 Analytical Formula Δ < 1e-6 PASS
Peak dBFS Target Normalization Exact Power Decibels 10^(target/20) Δ < 1e-5 PASS
Continuous Sine Wave RMS Energy A / √2 0.707107 × A Rel Error < 0.1% PASS

Installation & Usage ๐Ÿš€

# Install from Cargo
cargo install --git https://github.com/bhubbard/mlx-audio-rs

# 1. Kokoro Text-to-Speech
mlx-audio tts -t "The quick brown fox jumps over the lazy dog." -o audio.wav

# 2. Whisper Speech-to-Text
mlx-audio stt -a interview.wav -m base

# 3. Silero Voice Activity Detection
mlx-audio vad -a meeting.wav --threshold 0.5

# 4. Neural Codec Encode/Decode
mlx-audio codec -i recording.wav -o restored.wav