RepositorySwiftCHSwitzerland
ML

mlalma/kokoro-ios

Kokoro TTS for iOS and macOSX

297stars
146forks
10issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: kokoro-tts

#1 Repository of the month

2
TINIX TRENDING·Topic: kokoro

#2 Repository of the month

3
TINIX TRENDING·Topic: audio-processing

#3 Repository of the month

Kokoro TTS for Swift

✨ New in 1.0.8: Added timestamps for each token. Please check Kokoro Test App how to use them.

✨ New in 1.0.5: Voice styles are moved out of the library to the integrating application. Please check Kokoro Test App how to use them.

Kokoro is a high-quality TTS (text-to-speech) model, providing faster than real-time English audio generation.

NOTE: This is a SPM package of the TTS engine. For an application integrating Kokoro and showing how the neural speech synthesis works, please see KokoroTestApp project.

Kokoro TTS port is based on the great work done in MLX-Audio project, where the model was ported from PyTorch to MLX Python. This project ports the MLX Python code to MLX Swift.

Currently the library generates audio ~3.3 times faster than real-time on the release build on iPhone 13 Pro after warm up / first run.

Requirements

  • iOS 18.0+
  • macOS 15.0+
  • (Other Apple platforms may work as well)

Installation

Add KokoroSwift to your project using Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/mlalma/kokoro-ios.git", from: "1.0.0")
]

Then add it to your target:

.target(
    name: "YourTarget",
    dependencies: [
        .product(name: "KokoroSwift", package: "kokoro-ios")
    ]
)

Usage

import KokoroSwift

// Initialize the TTS engine
let modelPath = URL(fileURLWithPath: "path/to/your/model")
let tts = KokoroTTS(modelPath: modelPath, g2p: .misaki)

// Generate speech
let voiceEmbedding = ... // See KokoroTestApp on how to get a voice style as an `MLXArray`
let text = "Hello, this is a test of Kokoro TTS."
let audioBuffer = try tts.generateAudio(voice: voiceEmbedding, language: .enUS, text: text)

// audioBuffer now contains the synthesized speech

G2P (Grapheme-to-Phoneme) Options

  • .misaki - MisakiSwift, default G2P processor
  • .espeak - eSpeakNG, an alternative G2P processor (commented out in current version)

Model Files

You'll need to provide your own Kokoro TTS model file due to its large size as well as voice style. Please see example project Kokoro Test App how they can be included as a part of the application package.

Dependencies

This package depends on:

License

This project is licensed under MIT License - see the LICENSE file for details.

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
Neywa-Labs/mlx-audio

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.

8.3k
Nov 25, 2026
RepositoryPython
debpalash/VoiceStudio

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

121.8k
Dec 2, 2026
RepositoryPython
unslothai/unsloth

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

80.6k
Dec 2, 2026
RepositoryDart
flutter/flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

181.5k
Nov 28, 2026
RepositoryC++
react/react-native

A framework for building native applications using React

127.0k
Nov 27, 2026
RepositoryTypeScript
expo/expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

53.9k
Dec 2, 2026
Modeltext-to-speech
hexgrad/Kokoro-82M

Kokoro is an open-weight TTS model with 82 million parameters. Despite its lightweight architecture, it delivers comparable quality to larger models while being significantly faster and more cost-efficient. With Apache-licensed weights, Kokoro can be...

♥0
13.9M
Apr 10, 2025
RepositoryPython
coqui-ai/TTS

🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production

46.3k
Aug 16, 2024
RepositoryPython
OpenBMB/VoxCPM

VoxCPM2: Tokenizer-Free TTS for Multilingual Speech Generation, Creative Voice Design, and True-to-Life Cloning

43.1k
Nov 9, 2026