Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2025-02-07 22:20:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-02-07 22:20:51 +0800
Commit
84c4fe698890090b5fb042260407a8c7f1fb66bf
84c4fe69
1 parent
f90f9da3
Add MFC example for Kokoro TTS 1.0 (#1815)
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
29 行增加
和
8 行删除
mfc-examples/NonStreamingTextToSpeech/NonStreamingTextToSpeechDlg.cpp
mfc-examples/NonStreamingTextToSpeech/NonStreamingTextToSpeechDlg.cpp
查看文件 @
84c4fe6
...
...
@@ -453,13 +453,26 @@ void CNonStreamingTextToSpeechDlg::Init() {
error_message
+=
"
\r\n
to download models.
\r\n
"
;
error_message
+=
"
\r\n
We give several examples below
\r\n
"
;
error_message
+=
" 1. Use a Kokoro TTS model
\r\n
"
;
error_message
+=
" 2. Use a VITS Piper TTS model
\r\n
"
;
error_message
+=
" 3. Use a VITS Chinese TTS model
\r\n
"
;
error_message
+=
" 4. Use a Matcha TTS model
\r\n
"
;
error_message
+=
" 1. Use a Kokoro TTS model (multi-lingual, e.g, English + Chinese)
\r\n
"
;
error_message
+=
" 2. Use a Kokoro TTS model (English only)
\r\n
"
;
error_message
+=
" 3. Use a VITS Piper TTS model
\r\n
"
;
error_message
+=
" 4. Use a VITS Chinese TTS model
\r\n
"
;
error_message
+=
" 5. Use a Matcha TTS model
\r\n
"
;
error_message
+=
"
\r\n
"
;
error_message
+=
"----------1. Use a Kokoro TTS model----------
\r\n
"
"----------1. Use a Kokoro TTS model (multi-lingual, eg., English + Chinese)----------
\r\n
"
"(a) Download the model from
\r\n
"
" https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2
\r\n
"
"(b) Uncompress it and you will get a directory kokoro-multi-lang-v1_0
\r\n
"
"(c) Switch to the directory kokoro-multi-lang-v1_0
\r\n
"
"(d) Copy the current exe to the directory kokoro-multi-lang-v1_0
\r\n
"
"(e).Done! You can now run the exe in the directory kokoro-multi-lang-v1_0
\r\n
"
;
error_message
+=
"
\r\n
"
;
error_message
+=
"----------2. Use a Kokoro TTS model (English only)----------
\r\n
"
"(a) Download the model from
\r\n
"
" https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-en-v0_19.tar.bz2
\r\n
"
"(b) Uncompress it and you will get a directory kokoro-en-v0_19
\r\n
"
...
...
@@ -470,7 +483,7 @@ void CNonStreamingTextToSpeechDlg::Init() {
error_message
+=
"
\r\n
"
;
error_message
+=
"----------
2
. Use a VITS Piper TTS model----------
\r\n
"
"----------
3
. Use a VITS Piper TTS model----------
\r\n
"
"(a) Download the model from
\r\n
"
" https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
\r\n
"
"(b) Uncompress it and you will get a directory vits-piper-en_US-amy-low
\r\n
"
...
...
@@ -482,7 +495,7 @@ void CNonStreamingTextToSpeechDlg::Init() {
error_message
+=
"
\r\n
"
;
error_message
+=
"----------
3
. Use a VITS Chinese TTS model----------
\r\n
"
"----------
4
. Use a VITS Chinese TTS model----------
\r\n
"
"(a) Download the model from
\r\n
"
" https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-vits-zh-ll.tar.bz2
\r\n
"
"(b) Uncompress it and you will get a directory sherpa-onnx-vits-zh-ll
\r\n
"
...
...
@@ -493,7 +506,7 @@ void CNonStreamingTextToSpeechDlg::Init() {
error_message
+=
"
\r\n
"
;
error_message
+=
"----------
4
. Use a Matcha TTS model----------
\r\n
"
"----------
5
. Use a Matcha TTS model----------
\r\n
"
"(a) Download the model from
\r\n
"
" https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
\r\n
"
"(b) Uncompress it and you will get a directory matcha-icefall-zh-baker
\r\n
"
...
...
@@ -523,6 +536,10 @@ void CNonStreamingTextToSpeechDlg::Init() {
config
.
model
.
kokoro
.
voices
=
"./voices.bin"
;
config
.
model
.
kokoro
.
tokens
=
"./tokens.txt"
;
config
.
model
.
kokoro
.
data_dir
=
"./espeak-ng-data"
;
if
(
Exists
(
"./dict/jieba.dict.utf8"
)
&&
Exists
(
"./lexicon-zh.txt"
))
{
config
.
model
.
kokoro
.
dict_dir
=
"./dict"
;
config
.
model
.
kokoro
.
lexicon
=
"./lexicon-us-en.txt,./lexicon-zh.txt"
;
}
}
else
if
(
Exists
(
"./hifigan.onnx"
))
{
// it is a matcha tts model
config
.
model
.
matcha
.
acoustic_model
=
"./model.onnx"
;
...
...
@@ -561,6 +578,10 @@ void CNonStreamingTextToSpeechDlg::Init() {
config
.
rule_fsts
=
"./phone.fst,./date.fst,number.fst"
;
}
if
(
Exists
(
"./phone-zh.fst"
)
&&
Exists
(
"./date-zh.fst"
)
&&
Exists
(
"./number-zh.fst"
))
{
config
.
rule_fsts
=
"./phone-zh.fst,./date-zh.fst,number-zh.fst"
;
}
if
(
Exists
(
"./rule.far"
))
{
config
.
rule_fars
=
"./rule.far"
;
}
...
...
请
注册
或
登录
后发表评论