Add C++ and Python API for Kokoro TTS models. (#1715)

This commit is contained in:
Fangjun Kuang
2025-01-16 14:24:51 +08:00
committed by GitHub
parent 9efe26a646
commit ffc6b480a0
27 changed files with 1193 additions and 29 deletions

View File

@@ -267,6 +267,25 @@ log "Offline TTS test"
# test waves are saved in ./tts
mkdir ./tts
log "kokoro-en-v0_19 test"
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
tar xf kokoro-en-v0_19.tar.bz2
rm kokoro-en-v0_19.tar.bz2
python3 ./python-api-examples/offline-tts.py \
--debug=1 \
--kokoro-model=./kokoro-en-v0_19/model.onnx \
--kokoro-voices=./kokoro-en-v0_19/voices.bin \
--kokoro-tokens=./kokoro-en-v0_19/tokens.txt \
--kokoro-data-dir=./kokoro-en-v0_19/espeak-ng-data \
--num-threads=2 \
--sid=10 \
--output-filename="./tts/kokoro-10.wav" \
"Today as always, men fall into two groups: slaves and free men. Whoever does not have two-thirds of his day for himself, is a slave, whatever he may be a statesman, a businessman, an official, or a scholar."
rm -rf kokoro-en-v0_19
log "matcha-ljspeech-en test"
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2