SuperAPI AI Directory

speech-kokoro

General & other

View repository

Updated 10-18 10:18

About this skill

Speech Kokoro

Use Kokoro-82M for local text-to-speech. Prefer the bundled CLI so generation is reproducible and does not depend on MCP.

Quick Start

Run the script with Python:

python "C:\Users\devan\.codex\skills\speech-kokoro\scripts\kokoro_tts.py" generate --text "Hello from Kokoro." --out "output\speech\hello.wav"

Default behavior:

  • Voice: af_sky
  • Speed: 1.25
  • Sample rate: 24000
  • Format: mono 16-bit PCM WAV
  • Device: CUDA when PyTorch reports CUDA availability, otherwise CPU

Commands

List voices:

python "C:\Users\devan\.codex\skills\speech-kokoro\scripts\kokoro_tts.py" voices

Generate speech:

python "C:\Users\devan\.codex\skills\speech-kokoro\scripts\kokoro_tts.py" generate --text "Welcome to the demo." --voice af_sky --speed 1.1 --out "output\speech\demo.wav"

Generate from a UTF-8 text file:

python "C:\Users\devan\.codex\skills\speech-kokoro\scripts\kokoro_tts.py" generate --text-file "script.txt" --out "output\speech\narration.wav"

Workflow

  1. Preserve the user's text exactly unless they ask for edits.
  2. Use af_sky unless the user names another Kokoro voice.
  3. Use voices when the user asks what voices are available.
  4. Write final files to a clear project output path, usually output\speech\.
  5. For long text, let the script segment and concatenate the audio.
  6. Report the output path, voice, speed, and whether CUDA or CPU was used.

Dependencies

Install only when missing:

python -m pip install kokoro numpy soundfile huggingface_hub

PyTorch is optional but recommended. The script will use CPU if CUDA is unavailable.

On Windows, Python 3.13 may force native spaCy/blis builds while installing Kokoro dependencies. If that happens, create a Python 3.11 or 3.12 virtual environment for Kokoro and run the same script with that interpreter.

Notes

  • kokoro must be importable for generation.
  • Voice discovery uses Hugging Face repo metadata when available and falls back to the known Kokoro voice list.
  • Do not store user secrets in this skill. Kokoro generation does not require an HF token for normal local use.