CoolFace
Apppublic

Ichika065/Esp32Ai-docker-test

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
App README

๐ŸŽค Kokoro TTS API

A fast Text-to-Speech API using Kokoro running on Hugging Face Docker Spaces.


๐Ÿš€ Live API

After deployment, your API will be available at:

  • โ€”Base URL: /
  • โ€”Docs: /docs
  • โ€”Health: /health
  • โ€”TTS Endpoint: /v1/audio/speech

๐ŸŒ Example Space URL

https://YOUR_SPACE.hf.space


๐Ÿ“ก TTS API Usage

POST /v1/audio/speech

Request:

json
{
  "input": "Hello world",
  "voice": "af_heart"
}

---

## โšก CPU Speed Tips (Hugging Face Free)

- Request text is normalized and trimmed for faster generation.
- Responses are cached in-memory for repeated `(input, voice)` calls.
- WAV encoding uses lightweight stdlib encoding for lower overhead.
- Runtime threads are limited to avoid CPU oversubscription.

Optional environment variable:

- `MAX_CHARS=350` (lower this to make responses faster on tiny CPU)