Skip to content

Commit 0aacf02

Browse files
authored
Add C++ runtime for vocos (#2014)
1 parent 623cdc9 commit 0aacf02

File tree

62 files changed

+558
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+558
-162
lines changed

.github/scripts/test-nodejs-addon-npm.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ rm -rf kokoro-en-v0_19
121121
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
122122
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
123123
rm matcha-icefall-en_US-ljspeech.tar.bz2
124-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
124+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
125125

126126
node ./test_tts_non_streaming_matcha_icefall_en.js
127-
rm hifigan_v2.onnx
127+
rm vocos-22khz-univ.onnx
128128
rm -rf matcha-icefall-en_US-ljspeech
129129

130130
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
131131
tar xvf matcha-icefall-zh-baker.tar.bz2
132132
rm matcha-icefall-zh-baker.tar.bz2
133-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
133+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
134134

135135
node ./test_tts_non_streaming_matcha_icefall_zh.js
136-
rm hifigan_v2.onnx
136+
rm vocos-22khz-univ.onnx
137137
rm -rf matcha-icefall-zh-baker
138138
ls -lh *.wav
139139

.github/scripts/test-nodejs-npm.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,26 @@ curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/m
4242
tar xvf matcha-icefall-zh-baker.tar.bz2
4343
rm matcha-icefall-zh-baker.tar.bz2
4444

45-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
45+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
4646

4747
node ./test-offline-tts-matcha-zh.js
4848

4949
rm -rf matcha-icefall-zh-baker
50-
rm hifigan_v2.onnx
50+
rm vocos-22khz-univ.onnx
51+
5152

5253
echo "---"
5354

5455
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2
5556
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
5657
rm matcha-icefall-en_US-ljspeech.tar.bz2
5758

58-
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
59+
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
5960

6061
node ./test-offline-tts-matcha-en.js
6162

6263
rm -rf matcha-icefall-en_US-ljspeech
63-
rm hifigan_v2.onnx
64+
rm vocos-22khz-univ.onnx
6465

6566
echo "---"
6667

.github/scripts/test-offline-tts.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,20 @@ curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/m
5050
tar xvf matcha-tts-fa_en-musa.tar.bz2
5151
rm matcha-tts-fa_en-musa.tar.bz2
5252

53-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
53+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
54+
5455

5556
$EXE \
5657
--matcha-acoustic-model=./matcha-tts-fa_en-musa/model.onnx \
57-
--matcha-vocoder=./hifigan_v2.onnx \
58+
--matcha-vocoder=./vocos-22khz-univ.onnx \
5859
--matcha-tokens=./matcha-tts-fa_en-musa/tokens.txt \
5960
--matcha-data-dir=./matcha-tts-fa_en-musa/espeak-ng-data \
6061
--output-filename=./tts/test-matcha-fa-en-musa.wav \
6162
--num-threads=2 \
6263
"How are you doing today? این یک نمونه ی تست فارسی است. This is a test."
6364

6465
rm -rf matcha-tts-fa_en-musa
65-
rm hifigan_v2.onnx
66+
rm vocos-22khz-univ.onnx
6667
ls -lh tts/*.wav
6768

6869
log "------------------------------------------------------------"
@@ -72,19 +73,20 @@ curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/m
7273
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
7374
rm matcha-icefall-en_US-ljspeech.tar.bz2
7475

75-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
76+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
77+
7678

7779
$EXE \
7880
--matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \
79-
--matcha-vocoder=./hifigan_v2.onnx \
81+
--matcha-vocoder=./vocos-22khz-univ.onnx \
8082
--matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt \
8183
--matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data \
8284
--num-threads=2 \
8385
--output-filename=./tts/matcha-ljspeech-1.wav \
8486
--debug=1 \
8587
"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."
8688

87-
rm hifigan_v2.onnx
89+
rm vocos-22khz-univ.onnx
8890
rm -rf matcha-icefall-en_US-ljspeech
8991
ls -lh tts/*.wav
9092

@@ -95,11 +97,11 @@ curl -O -SL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/m
9597
tar xvf matcha-icefall-zh-baker.tar.bz2
9698
rm matcha-icefall-zh-baker.tar.bz2
9799

98-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
100+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
99101

100102
$EXE \
101103
--matcha-acoustic-model=./matcha-icefall-zh-baker/model-steps-3.onnx \
102-
--matcha-vocoder=./hifigan_v2.onnx \
104+
--matcha-vocoder=./vocos-22khz-univ.onnx \
103105
--matcha-lexicon=./matcha-icefall-zh-baker/lexicon.txt \
104106
--matcha-tokens=./matcha-icefall-zh-baker/tokens.txt \
105107
--matcha-dict-dir=./matcha-icefall-zh-baker/dict \
@@ -110,7 +112,7 @@ $EXE \
110112

111113
$EXE \
112114
--matcha-acoustic-model=./matcha-icefall-zh-baker/model-steps-3.onnx \
113-
--matcha-vocoder=./hifigan_v2.onnx \
115+
--matcha-vocoder=./vocos-22khz-univ.onnx \
114116
--matcha-lexicon=./matcha-icefall-zh-baker/lexicon.txt \
115117
--matcha-tokens=./matcha-icefall-zh-baker/tokens.txt \
116118
--matcha-dict-dir=./matcha-icefall-zh-baker/dict \
@@ -119,7 +121,7 @@ $EXE \
119121
--output-filename=./tts/matcha-baker-zh-2.wav \
120122
"当夜幕降临,星光点点,伴随着微风拂面,我在静谧中感受着时光的流转,思念如涟漪荡漾,梦境如画卷展开,我与自然融为一体,沉静在这片宁静的美丽之中,感受着生命的奇迹与温柔。"
121123

122-
rm hifigan_v2.onnx
124+
rm vocos-22khz-univ.onnx
123125
rm -rf matcha-icefall-zh-baker
124126

125127
log "------------------------------------------------------------"

.github/scripts/test-python.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,18 +320,18 @@ curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/m
320320
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
321321
rm matcha-icefall-en_US-ljspeech.tar.bz2
322322

323-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
323+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
324324

325325
python3 ./python-api-examples/offline-tts.py \
326326
--matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \
327-
--matcha-vocoder=./hifigan_v2.onnx \
327+
--matcha-vocoder=./vocos-22khz-univ.onnx \
328328
--matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt \
329329
--matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data \
330330
--output-filename=./tts/test-matcha-ljspeech-en.wav \
331331
--num-threads=2 \
332332
"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."
333333

334-
rm hifigan_v2.onnx
334+
rm vocos-22khz-univ.onnx
335335
rm -rf matcha-icefall-en_US-ljspeech
336336

337337
log "matcha-baker-zh test"
@@ -340,11 +340,11 @@ curl -O -SL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/m
340340
tar xvf matcha-icefall-zh-baker.tar.bz2
341341
rm matcha-icefall-zh-baker.tar.bz2
342342

343-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
343+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
344344

345345
python3 ./python-api-examples/offline-tts.py \
346346
--matcha-acoustic-model=./matcha-icefall-zh-baker/model-steps-3.onnx \
347-
--matcha-vocoder=./hifigan_v2.onnx \
347+
--matcha-vocoder=./vocos-22khz-univ.onnx \
348348
--matcha-lexicon=./matcha-icefall-zh-baker/lexicon.txt \
349349
--matcha-tokens=./matcha-icefall-zh-baker/tokens.txt \
350350
--tts-rule-fsts=./matcha-icefall-zh-baker/phone.fst,./matcha-icefall-zh-baker/date.fst,./matcha-icefall-zh-baker/number.fst \
@@ -353,7 +353,7 @@ python3 ./python-api-examples/offline-tts.py \
353353
"某某银行的副行长和一些行政领导表示,他们去过长江和长白山; 经济不断增长。2024年12月31号,拨打110或者18920240511。123456块钱。"
354354

355355
rm -rf matcha-icefall-zh-baker
356-
rm hifigan_v2.onnx
356+
rm vocos-22khz-univ.onnx
357357

358358
log "vits-ljs test"
359359

.github/workflows/c-api.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ jobs:
228228
tar xvf matcha-icefall-zh-baker.tar.bz2
229229
rm matcha-icefall-zh-baker.tar.bz2
230230
231-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
231+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
232232
233233
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
234234
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
@@ -237,7 +237,7 @@ jobs:
237237
238238
rm ./matcha-tts-zh-c-api
239239
rm -rf matcha-icefall-*
240-
rm hifigan_v2.onnx
240+
rm vocos-22khz-univ.onnx
241241
242242
- name: Test Matcha TTS (en)
243243
shell: bash
@@ -252,7 +252,7 @@ jobs:
252252
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
253253
rm matcha-icefall-en_US-ljspeech.tar.bz2
254254
255-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
255+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
256256
257257
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
258258
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
@@ -261,7 +261,7 @@ jobs:
261261
262262
rm ./matcha-tts-en-c-api
263263
rm -rf matcha-icefall-*
264-
rm hifigan_v2.onnx
264+
rm vocos-22khz-univ.onnx
265265
266266
- uses: actions/upload-artifact@v4
267267
with:

.github/workflows/cxx-api.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ jobs:
237237
tar xvf matcha-icefall-zh-baker.tar.bz2
238238
rm matcha-icefall-zh-baker.tar.bz2
239239
240-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
240+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
241241
242242
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
243243
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
244244
245245
./matcha-tts-zh-cxx-api
246246
247247
rm -rf matcha-icefall-*
248-
rm hifigan_v2.onnx
248+
rm vocos-22khz-univ.onnx
249249
rm matcha-tts-zh-cxx-api
250250
251251
- name: Test Matcha TTS (en)
@@ -262,7 +262,7 @@ jobs:
262262
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
263263
rm matcha-icefall-en_US-ljspeech.tar.bz2
264264
265-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
265+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
266266
267267
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
268268
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
@@ -271,7 +271,7 @@ jobs:
271271
272272
rm matcha-tts-en-cxx-api
273273
rm -rf matcha-icefall-*
274-
rm hifigan_v2.onnx
274+
rm vocos-22khz-univ.onnx
275275
276276
- uses: actions/upload-artifact@v4
277277
with:

.github/workflows/run-java-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ jobs:
265265
rm -rf kokoro-en-*
266266
267267
rm -rf matcha-icefall-*
268-
rm hifigan_v2.onnx
268+
rm vocos-22khz-univ.onnx
269269
270270
./run-non-streaming-tts-piper-en.sh
271271
rm -rf vits-piper-*

android/SherpaOnnxTts/app/src/main/java/com/k2fsa/sherpa/onnx/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class MainActivity : AppCompatActivity() {
262262
// https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-zh-baker-chinese-1-female-speaker
263263
// modelDir = "matcha-icefall-zh-baker"
264264
// acousticModelName = "model-steps-3.onnx"
265-
// vocoder = "hifigan_v2.onnx"
265+
// vocoder = "vocos-22khz-univ.onnx"
266266
// lexicon = "lexicon.txt"
267267
// dictDir = "matcha-icefall-zh-baker/dict"
268268

@@ -271,7 +271,7 @@ class MainActivity : AppCompatActivity() {
271271
// https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-en-us-ljspeech-american-english-1-female-speaker
272272
// modelDir = "matcha-icefall-en_US-ljspeech"
273273
// acousticModelName = "model-steps-3.onnx"
274-
// vocoder = "hifigan_v2.onnx"
274+
// vocoder = "vocos-22khz-univ.onnx"
275275
// dataDir = "matcha-icefall-en_US-ljspeech/espeak-ng-data"
276276

277277
// Example 9

android/SherpaOnnxTtsEngine/app/src/main/java/com/k2fsa/sherpa/onnx/tts/engine/TtsEngine.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ object TtsEngine {
131131
// https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-zh-baker-chinese-1-female-speaker
132132
// modelDir = "matcha-icefall-zh-baker"
133133
// acousticModelName = "model-steps-3.onnx"
134-
// vocoder = "hifigan_v2.onnx"
134+
// vocoder = "vocos-22khz-univ.onnx"
135135
// lexicon = "lexicon.txt"
136136
// dictDir = "matcha-icefall-zh-baker/dict"
137137
// lang = "zho"
@@ -141,7 +141,7 @@ object TtsEngine {
141141
// https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-en-us-ljspeech-american-english-1-female-speaker
142142
// modelDir = "matcha-icefall-en_US-ljspeech"
143143
// acousticModelName = "model-steps-3.onnx"
144-
// vocoder = "hifigan_v2.onnx"
144+
// vocoder = "vocos-22khz-univ.onnx"
145145
// dataDir = "matcha-icefall-en_US-ljspeech/espeak-ng-data"
146146
// lang = "eng"
147147

c-api-examples/matcha-tts-en-c-api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-i
1313
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
1414
rm matcha-icefall-en_US-ljspeech.tar.bz2
1515
16-
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
16+
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
1717
1818
./matcha-tts-en-c-api
1919
@@ -40,7 +40,7 @@ int32_t main(int32_t argc, char *argv[]) {
4040
config.model.matcha.acoustic_model =
4141
"./matcha-icefall-en_US-ljspeech/model-steps-3.onnx";
4242

43-
config.model.matcha.vocoder = "./hifigan_v2.onnx";
43+
config.model.matcha.vocoder = "./vocos-22khz-univ.onnx";
4444

4545
config.model.matcha.tokens = "./matcha-icefall-en_US-ljspeech/tokens.txt";
4646

c-api-examples/matcha-tts-zh-c-api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-i
1313
tar xvf matcha-icefall-zh-baker.tar.bz2
1414
rm matcha-icefall-zh-baker.tar.bz2
1515
16-
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
16+
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
1717
1818
./matcha-tts-zh-c-api
1919
@@ -39,7 +39,7 @@ int32_t main(int32_t argc, char *argv[]) {
3939
memset(&config, 0, sizeof(config));
4040
config.model.matcha.acoustic_model =
4141
"./matcha-icefall-zh-baker/model-steps-3.onnx";
42-
config.model.matcha.vocoder = "./hifigan_v2.onnx";
42+
config.model.matcha.vocoder = "./vocos-22khz-univ.onnx";
4343
config.model.matcha.lexicon = "./matcha-icefall-zh-baker/lexicon.txt";
4444
config.model.matcha.tokens = "./matcha-icefall-zh-baker/tokens.txt";
4545
config.model.matcha.dict_dir = "./matcha-icefall-zh-baker/dict";

cxx-api-examples/matcha-tts-en-cxx-api.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-i
1313
tar xvf matcha-icefall-en_US-ljspeech.tar.bz2
1414
rm matcha-icefall-en_US-ljspeech.tar.bz2
1515
16-
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
16+
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
1717
1818
./matcha-tts-en-cxx-api
1919
@@ -39,7 +39,7 @@ int32_t main(int32_t argc, char *argv[]) {
3939
config.model.matcha.acoustic_model =
4040
"./matcha-icefall-en_US-ljspeech/model-steps-3.onnx";
4141

42-
config.model.matcha.vocoder = "./hifigan_v2.onnx";
42+
config.model.matcha.vocoder = "./vocos-22khz-univ.onnx";
4343

4444
config.model.matcha.tokens = "./matcha-icefall-en_US-ljspeech/tokens.txt";
4545

cxx-api-examples/matcha-tts-zh-cxx-api.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-i
1313
tar xvf matcha-icefall-zh-baker.tar.bz2
1414
rm matcha-icefall-zh-baker.tar.bz2
1515
16-
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
16+
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
1717
1818
./matcha-tts-zh-cxx-api
1919
@@ -37,7 +37,7 @@ int32_t main(int32_t argc, char *argv[]) {
3737
OfflineTtsConfig config;
3838
config.model.matcha.acoustic_model =
3939
"./matcha-icefall-zh-baker/model-steps-3.onnx";
40-
config.model.matcha.vocoder = "./hifigan_v2.onnx";
40+
config.model.matcha.vocoder = "./vocos-22khz-univ.onnx";
4141
config.model.matcha.lexicon = "./matcha-icefall-zh-baker/lexicon.txt";
4242
config.model.matcha.tokens = "./matcha-icefall-zh-baker/tokens.txt";
4343
config.model.matcha.dict_dir = "./matcha-icefall-zh-baker/dict";

dart-api-examples/tts/run-matcha-en.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ if [ ! -f ./matcha-icefall-en_US-ljspeech/model-steps-3.onnx ]; then
1414
rm matcha-icefall-en_US-ljspeech.tar.bz2
1515
fi
1616

17-
if [ ! -f ./hifigan_v2.onnx ]; then
18-
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx
17+
if [ ! -f ./vocos-22khz-univ.onnx ]; then
18+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx
1919
fi
2020

2121
dart run \
2222
./bin/matcha-en.dart \
2323
--acoustic-model ./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \
24-
--vocoder ./hifigan_v2.onnx \
24+
--vocoder ./vocos-22khz-univ.onnx \
2525
--tokens ./matcha-icefall-en_US-ljspeech/tokens.txt \
2626
--data-dir ./matcha-icefall-en_US-ljspeech/espeak-ng-data \
2727
--sid 0 \

0 commit comments

Comments
 (0)