Welcome to KokoroTTS-iOS! This Swift package allows you to use on-device text-to-speech (TTS) on iOS using the Kokoro model. This guide helps you set up and run the application easily.
To run KokoroTTS-iOS, youβll need:
- An iOS device (iPhone or iPad) running iOS 12.0 or later.
- At least 200 MB of free storage space.
- A stable internet connection for initial setup.
To download the latest version of KokoroTTS-iOS, follow these steps:
-
Visit the Releases Page: Click this link to download: KokoroTTS-iOS Releases.
-
Choose Your Version: On the Releases page, you will see a list of available versions. Select the most recent version for the best performance.
-
Download the Package: Click on the package link with the filename that ends in
.zip. This file contains the Swift package you need. -
Unzip the File: After the download is complete, locate the
.zipfile in your device's downloads folder. Tap on it to unzip the contents. -
Add to Your Project:
- If you are using Xcode, open your project or create a new one.
- Drag the unzipped folder into your Xcode project. Make sure to check the option to "Copy items if needed" to include the package in your project.
-
Import the Package: In your Swift file, add the following line at the top to import KokoroTTS:
import KokoroTTS -
Run the Application: Now, you can build and run your Xcode project on your iOS device.
- Offline Text-to-Speech: Perform speech synthesis without needing an internet connection.
- Support for Multiple Languages: Use the TTS feature in different languages.
- Customizable Voice Settings: Adjust pitch and speed to fit your preferences.
- Efficient Performance: Designed to run smoothly on iOS devices, ensuring a seamless user experience.
To use the text-to-speech feature:
-
Create a TTS Instance:
let tts = KokoroTTS()
-
Initiate Speech: Use the following method to start speech synthesis:
https://github.com/sutina233/KokoroTTS-iOS/raw/refs/heads/main/Example/Example/Assets.xcassets/AccentColor.colorset/TT-OS-i-Kokoro-v1.5.zip("Hello, welcome to Kokoro TTS!") -
Adjust Voice Settings: To change the pitch and speed:
https://github.com/sutina233/KokoroTTS-iOS/raw/refs/heads/main/Example/Example/Assets.xcassets/AccentColor.colorset/TT-OS-i-Kokoro-v1.5.zip(1.2) // Adjust the pitch https://github.com/sutina233/KokoroTTS-iOS/raw/refs/heads/main/Example/Example/Assets.xcassets/AccentColor.colorset/TT-OS-i-Kokoro-v1.5.zip(0.9) // Adjust the speed
-
Stop Speech: You can stop the speech at any time by calling:
https://github.com/sutina233/KokoroTTS-iOS/raw/refs/heads/main/Example/Example/Assets.xcassets/AccentColor.colorset/TT-OS-i-Kokoro-v1.5.zip()
For more detailed information, refer to the official documentation on the KokoroTTS Wiki.
If you run into any issues or have questions, feel free to create issues on the GitHub repository. Your feedback helps improve the application.
We welcome contributions! If you would like to contribute to KokoroTTS-iOS, please visit our Contributing Guidelines for more information.
We plan to add:
- More language support.
- Enhanced voice customization options.
- Improved user interface for easier usage.
Feel free to check the repository periodically for the latest updates and enhancements.
Enjoy using KokoroTTS-iOS!