Scripts2026年3月31日·1 分钟阅读

Kokoro — Lightweight 82M TTS in 9 Languages

Kokoro is an 82M parameter text-to-speech model delivering quality comparable to larger models. 6.2K+ GitHub stars. Supports English, Spanish, French, Japanese, Chinese, and more. Apache 2.0.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

# Install
pip install kokoro

# Generate speech
python -c "
from kokoro import KPipeline
pipe = KPipeline(lang_code='a')  # 'a' = American English
generator = pipe('Hello, this is Kokoro text to speech!', voice='af_heart')
for i, (gs, ps, audio) in enumerate(generator):
    pass  # audio is a numpy array
import soundfile as sf
sf.write('hello.wav', audio, 24000)
print('Saved hello.wav')
"

介绍

Kokoro is an open-weight text-to-speech model with just 82 million parameters that delivers quality comparable to much larger models while being faster and more cost-efficient. With 6,200+ GitHub stars and Apache 2.0 license, Kokoro supports 9 languages: American English, British English, Spanish, French, Italian, Hindi, Japanese, Brazilian Portuguese, and Mandarin Chinese. It features streaming audio generation, runs on CPU and Apple Silicon GPU, and uses the misaki library for grapheme-to-phoneme conversion.

Best for: Developers needing lightweight, high-quality TTS without large GPU requirements Works with: Claude Code, OpenAI Codex, Cursor, Gemini CLI, Windsurf Languages: English (US/UK), Spanish, French, Italian, Hindi, Japanese, Portuguese, Chinese


Key Features

  • 82M parameters: Lightweight yet high-quality speech synthesis
  • 9 languages: English, Spanish, French, Italian, Hindi, Japanese, Portuguese, Chinese
  • Apache 2.0 weights: Unrestricted commercial deployment
  • Streaming audio: Generator-based interface for real-time output
  • CPU + Apple Silicon: Runs efficiently without NVIDIA GPU
  • Multiple voices: Various speaker styles per language
  • Cost-efficient: Fraction of the compute cost of larger TTS models

FAQ

Q: What is Kokoro? A: Kokoro is an 82M parameter TTS model with 6.2K+ stars delivering quality comparable to larger models in 9 languages. Apache 2.0 licensed, runs on CPU and Apple Silicon.

Q: How do I install Kokoro? A: Run pip install kokoro. Use KPipeline(lang_code='a') for American English, then generate speech with the pipe() method.


🙏

来源与感谢

Created by Hexgrad. Licensed under Apache 2.0. hexgrad/kokoro — 6,200+ GitHub stars

相关资产