✨ New: Voice styles are moved out of the library to the integrating application. The application provides now 28 different voice styles that can be used to generate speech.
A SwiftUI test application for the Kokoro TTS (Text-to-Speech) model, demonstrating high-quality faster than real-time neural speech synthesis on macOS and iOS using Apple's MLX framework.
- iOS 18.0+
- macOS 15.0+
- (Other Apple platforms may work as well)
NOTE: The application works only on iOS devices and it won't work on iOS emulator(s) because of lack of MLX support.
kokoro-v1_0.safetensors, ~600MB). You must have Git LFS installed and configured before cloning:
# Using Homebrew (macOS)
brew install git-lfs
git lfs installAfter that, cloning and running the application is done as any other app:
-
Clone the repository (Git LFS will automatically download the model file):
git clone https://github.com/yourusername/KokoroTestApp.git cd KokoroTestApp -
Verify model file: Ensure the model file was downloaded correctly:
ls -la Resources/kokoro-v1_0.safetensors # Should show a file of approximately 600MBIf it failed, download the file manually:
- View Resources/kokoro-v1_0.safetensors
- On the right side of the screen, find the group of buttons: Raw, ⬇️, ✏️
- Click the download icon ⬇️, and save it in [your repository]/Resources directory
-
Open in Xcode:
open KokoroTestApp.xcodeproj
-
Build and run the project in Xcode
- High-Quality TTS: Leverages the Kokoro neural TTS model for natural-sounding speech synthesis
- Multiple voices: Supports different voice options
- Faster than real-time generation: Fast audio generation with performance metrics
- MLX integration: Optimized for Apple Silicon using the MLX machine learning framework
This project uses Swift Package Manager with the following dependencies:
- Kokoro iOS: Kokoro TTS engine
- MLX: Apple's MLX machine learning framework
- MisakiSwift: Misaki G2P library
- MLXUtilsLibrary: For reading the .npz file for voice styles
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.