Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bortronx/Kokoro-FastAPIdotNETClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kokoro-FastAPI .NET Client

.NET 8.0
Docker

A .NET Client for Kokoro-FastAPI, built to handle long-file text-to-speech (TTS) efficiently.
It improves performance and provides greater control over converting long text files into speech.


🚀 Features

  • Convert long .txt files into speech using Kokoro-FastAPI.
  • Fine-grained control over chunk size, starting points, and continuation.
  • Automatic Docker container restart handling.
  • Configurable voice, model, and speed.

📦 Build

✅ Prerequisites


▶️ Launch Server on Docker

  1. Place your books in .txt format next to the executable.
  2. Double-click the executable to start the app.
    • Watch the terminal window for logs and status updates.

⚙️ Command-Line Arguments

Argument Type Description
NextChunkIndex=<int> Integer Set the next chunk index.
OutputFolderName=<string> String Set the output folder name.
LastLineIndex=<int> Integer Set the last line index.
LastWordIndex=<int> Integer Set the last word index.
MaxCharacters=<int> Integer Maximum characters per chunk.
Model=<string> String TTS model to use.
Voice=<string> String Voice to use.
Speed=<float> Float Voice playback speed.
Continue=<int,int> Tuple Continue from line + word index.
IsManual=<bool> Boolean Enable/disable manual parameter selection.
StartFromChunk=<int> Integer Resume from a specific chunk.
DockerTTSContainerID=<string> String Docker TTS Container ID (required for restart).

🔧 Quick Run

Skip manual inputs and run directly from CMD:

KokoroFastApiUser.exe IsManual=false

💡 Example

KokoroFastApiUser.exe Voice=af_sky StartFromChunk=4895

⚠️ Troubleshooting

Sometimes the model running inside the container may hang indefinitely.

  • The client will attempt to automatically restart the Docker container.
  • If restart fails:
    1. Copy the chunk number where processing stopped.

    2. Manually restart the Docker container.

    3. Resume with the following command:

      KokoroFastApiUser.exe StartFromChunk=<chunkNumber>

👩‍💻 Development

Requirements


📋 Roadmap / TODO

  • Improve handling of infinite loading in the container.
  • Auto-launch Docker container if already installed.
  • Fix Docker restart edge cases.

📜 License

MIT License © 2025 Bortronx

About

Kokoro-FastAPI .NET Client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages