|
12 | 12 |
|
13 | 13 | Usage:
|
14 | 14 |
|
15 |
| -Example (1/6) |
| 15 | +Example (1/7) |
16 | 16 |
|
17 | 17 | wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
|
18 | 18 | tar xf vits-piper-en_US-amy-low.tar.bz2
|
|
24 | 24 | --output-filename=./generated.wav \
|
25 | 25 | "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."
|
26 | 26 |
|
27 |
| -Example (2/6) |
| 27 | +Example (2/7) |
28 | 28 |
|
29 | 29 | wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
|
30 | 30 | tar xvf vits-icefall-zh-aishell3.tar.bz2
|
|
38 | 38 | --output-filename=./liubei-21.wav \
|
39 | 39 | "勿以恶小而为之,勿以善小而不为。惟贤惟德,能服于人。122334"
|
40 | 40 |
|
41 |
| -Example (3/6) |
| 41 | +Example (3/7) |
42 | 42 |
|
43 | 43 | wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-vits-zh-ll.tar.bz2
|
44 | 44 | tar xvf sherpa-onnx-vits-zh-ll.tar.bz2
|
|
54 | 54 | --output-filename=./test-2.wav \
|
55 | 55 | "当夜幕降临,星光点点,伴随着微风拂面,我在静谧中感受着时光的流转,思念如涟漪荡漾,梦境如画卷展开,我与自然融为一体,沉静在这片宁静的美丽之中,感受着生命的奇迹与温柔。2024年5月11号,拨打110或者18920240511。123456块钱。"
|
56 | 56 |
|
57 |
| -Example (4/6) |
| 57 | +Example (4/7) |
58 | 58 |
|
59 | 59 | curl -O -SL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
|
60 | 60 | tar xvf matcha-icefall-zh-baker.tar.bz2
|
|
72 | 72 | --output-filename=./test-matcha.wav \
|
73 | 73 | "某某银行的副行长和一些行政领导表示,他们去过长江和长白山; 经济不断增长。2024年12月31号,拨打110或者18920240511。123456块钱。"
|
74 | 74 |
|
75 |
| -Example (5/6) |
| 75 | +Example (5/7) |
76 | 76 |
|
77 | 77 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
|
78 | 78 | tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
|
|
89 | 89 | --num-threads=2 \
|
90 | 90 | "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."
|
91 | 91 |
|
92 |
| -Example (6/6) |
| 92 | +Example (6/7) |
| 93 | +
|
| 94 | +(This version of kokoro supports only English) |
93 | 95 |
|
94 | 96 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
|
95 | 97 | tar xf kokoro-en-v0_19.tar.bz2
|
|
106 | 108 | --output-filename="./kokoro-10.wav" \
|
107 | 109 | "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."
|
108 | 110 |
|
| 111 | +Example (7/7) |
| 112 | +
|
| 113 | +(This version of kokoro supports English, Chinese, etc.) |
| 114 | +
|
| 115 | +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2 |
| 116 | +tar xf kokoro-multi-lang-v1_0.tar.bz2 |
| 117 | +rm kokoro-multi-lang-v1_0.tar.bz2 |
| 118 | +
|
| 119 | +python3 ./python-api-examples/offline-tts.py \ |
| 120 | + --debug=1 \ |
| 121 | + --kokoro-model=./kokoro-multi-lang-v1_0/model.onnx \ |
| 122 | + --kokoro-voices=./kokoro-multi-lang-v1_0/voices.bin \ |
| 123 | + --kokoro-tokens=./kokoro-multi-lang-v1_0/tokens.txt \ |
| 124 | + --kokoro-data-dir=./kokoro-multi-lang-v1_0/espeak-ng-data \ |
| 125 | + --kokoro-dict-dir=./kokoro-multi-lang-v1_0/dict \ |
| 126 | + --kokoro-lexicon=./kokoro-multi-lang-v1_0/lexicon-us-en.txt,./kokoro-multi-lang-v1_0/lexicon-zh.txt \ |
| 127 | + --num-threads=2 \ |
| 128 | + --sid=18 \ |
| 129 | + --output-filename="./kokoro-18-zh-en.wav" \ |
| 130 | + "中英文语音合成测试。This is generated by next generation Kaldi using Kokoro without Misaki. 你觉得中英文说的如何呢?" |
| 131 | +
|
109 | 132 | You can find more models at
|
110 | 133 | https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models
|
111 | 134 |
|
@@ -234,6 +257,20 @@ def add_kokoro_args(parser):
|
234 | 257 | help="Path to the dict directory of espeak-ng.",
|
235 | 258 | )
|
236 | 259 |
|
| 260 | + parser.add_argument( |
| 261 | + "--kokoro-dict-dir", |
| 262 | + type=str, |
| 263 | + default="", |
| 264 | + help="Path to the dict directory for models using jieba. Needed only by multilingual kokoro", |
| 265 | + ) |
| 266 | + |
| 267 | + parser.add_argument( |
| 268 | + "--kokoro-lexicon", |
| 269 | + type=str, |
| 270 | + default="", |
| 271 | + help="Path to lexicon.txt for kokoro. Needed only by multilingual kokoro", |
| 272 | + ) |
| 273 | + |
237 | 274 |
|
238 | 275 | def get_args():
|
239 | 276 | parser = argparse.ArgumentParser(
|
@@ -342,6 +379,8 @@ def main():
|
342 | 379 | voices=args.kokoro_voices,
|
343 | 380 | tokens=args.kokoro_tokens,
|
344 | 381 | data_dir=args.kokoro_data_dir,
|
| 382 | + dict_dir=args.kokoro_dict_dir, |
| 383 | + lexicon=args.kokoro_lexicon, |
345 | 384 | ),
|
346 | 385 | provider=args.provider,
|
347 | 386 | debug=args.debug,
|
|
0 commit comments