MCPcopy Index your code
hub / github.com/NeuralFalconYT/Kokoro-TTS-Subtitle

github.com/NeuralFalconYT/Kokoro-TTS-Subtitle @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
118 symbols 305 edges 5 files 12 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Kokoro TTS V1.0 with Subtitle & SRT Dubbing

Open In Colab

HuggingFace Space Demo

Alternative ways to use Kokoro-TTS kokoro-onnx, Kokoro-FastAPI, kokoro

app

srt dub

Installation

Prerequisites

  • At least Python 3.10
  • Git
  • (Optional) Virtual Environment for dependency isolation

Steps to Install and Run

  1. Clone the Repository sh https://github.com/NeuralFalconYT/Kokoro-TTS-Subtitle.git cd Kokoro-TTS-Subtitle

  2. (Optional) Create and Activate a Virtual Environment

  3. Windows: sh python -m venv myenv myenv\Scripts\activate
  4. Mac/Linux: sh python3 -m venv myenv source myenv/bin/activate

  5. Install PyTorch

  6. Forcefully install Torch with CUDA. If you did not, then requirements.txt will install the CPU version [It's happening with my system.]
  7. Check CUDA Version (for GPU setup): bash nvcc --version Find your CUDA version example 11.8

  8. Visit PyTorch Get Started and install the version compatible with your CUDA setup.:

    • For CUDA 11.8: pip install torch --index-url https://download.pytorch.org/whl/cu118
    • For CUDA 12.1: pip install torch --index-url https://download.pytorch.org/whl/cu121
    • For CUDA 12.4: pip install torch --index-url https://download.pytorch.org/whl/cu124
  9. Install Dependencies

  10. Windows/Mac/Linux: sh pip install -r requirements.txt

  1. Install eSpeak NG

  2. For Windows:

  3. Download the eSpeak NG 1.50 release from the eSpeak NG GitHub Releases. [Or, You can try eSpeak NG latest Version]
  4. Locate and download the file named espeak-ng-X64.msi.
  5. Run the installer and follow the installation steps. Ensure that you install eSpeak NG in the default directory: C:\Program Files\eSpeak NG > Note: This default path is required for the application to locate eSpeak NG properly.

  6. For Linux:

  7. Open your terminal.
  8. Install eSpeak NG using the following command: bash sudo apt-get -qq -y install espeak-ng > /dev/null 2>&1 > Note: This command suppresses unnecessary output for a cleaner installation process.

  1. Run the Application

If you used a virtual environment, make sure you enabled it. - Windows/Mac/Linux: sh python beta.py Or,

python one_clicker.py Then, double-click on run_app.bat (Windows) to execute the script.

  1. Use Kokoko TTS Gradio app as an API in your other project:
    Check out scripts/api.py Code
Uninstallation Guide for Kokoro v1.0
If You Used a Virtual Environment:
  1. Simply delete the kokoro_v1 folder from your project directory.
If You Did Not Use a Virtual Environment:
  1. Inside the kokoro_v1 directory, run the following command to uninstall dependencies: bash pip uninstall -r requirements.txt
  2. Uninstall PyTorch: bash pip uninstall torch

To clear the HuggingFace cache models:

  • Navigate to C:\Users\<username>\.cache\huggingface\hub
  • Delete the contents of the hub folder. That's it! You've successfully removed everything.

🛠️ Fix for Japanese Audio Generation Error

If you encounter an error while generating Japanese audio, try the following steps:

  1. Uninstall existing unidic:

bash pip uninstall unidic -y

  1. Reinstall unidic:

bash pip install unidic

  1. Download the dictionary data:

bash python -m unidic download Note: This solution is likely to work, the same issue has been observed on both Colab and Hugging Face.

License

Kokoro model is licensed under the [Apache License 2.0]

Credits

Kokoro HuggingFace

Core symbols most depended-on inside this repo

format_srt_time
called by 4
srt_dub.py
format_srt_time
called by 4
beta.py
format_srt_time
called by 4
app.py
generate_and_save_audio
called by 3
srt_dub.py
modify_filename
called by 3
srt_dub.py
change_speed
called by 3
srt_dub.py
generate_and_save_audio
called by 3
beta.py
split_line_by_char_limit
called by 3
beta.py

Shape

Function 94
Method 22
Class 2

Languages

Python100%

Modules by API surface

beta.py48 symbols
srt_dub.py47 symbols
app.py22 symbols
scripts/api.py1 symbols

For agents

$ claude mcp add Kokoro-TTS-Subtitle \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page