Installation process details
安装分为三个主要阶段,建议使用Python 3.12环境:
- Foundation Installation:通过pip执行
pip install -U kokoro-onnx
获取核心包 - 资源文件配置:需下载
kokoro-v0_19.onnx
模型文件(约300MB)和voices.json
语音配置文件 - 环境初始化: Implementation
uv init -p 3.12 && uv add kokoro-onnx soundfile
完成依赖装配
Key Considerations
- 文件位置:所有资源文件必须置于同一工作目录
- hardware requirement:M1/M2芯片Mac用户可获得最佳性能,x86架构设备需保证至少4GB内存
- network dependency:首次运行会下载约500MB的语音数据库(具体视所选语音包而定)
Verify Installation
可通过运行示例脚本hello.py
测试安装,成功后会生成指定文本的WAV格式音频文件。
This answer comes from the articleKokoro-ONNX: Efficient Text-to-Speech Tool with Multi-Language and Multi-Voice SupportThe