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 17:58:23 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-02-07 17:58:23 +0800
Commit
c49bbce43cff2738d39075c2ad7d2d617fdc9851
c49bbce4
1 parent
06106795
Add Flutter example for Kokoro TTS 1.0 (#1810)
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
19 行增加
和
1 行删除
flutter-examples/tts/lib/model.dart
flutter-examples/tts/lib/model.dart
查看文件 @
c49bbce
...
...
@@ -92,6 +92,15 @@ Future<sherpa_onnx.OfflineTts> createOfflineTts() async {
// voices = 'voices.bin';
// dataDir = 'kokoro-en-v0_19/espeak-ng-data';
// Example 9
// https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/kokoro.html
// modelDir = 'kokoro-multi-lang-v1_0';
// modelName = 'model.onnx';
// voices = 'voices.bin';
// dataDir = 'kokoro-multi-lang-v1_0/espeak-ng-data';
// dictDir = 'kokoro-multi-lang-v1_0/dict';
// lexicon = 'kokoro-multi-lang-v1_0/lexicon-us-en.txt,kokoro-multi-lang-v1_0/lexicon-zh.txt';
// ============================================================
// Please don't change the remaining part of this function
// ============================================================
...
...
@@ -121,7 +130,14 @@ Future<sherpa_onnx.OfflineTts> createOfflineTts() async {
ruleFars
=
tmp
.
join
(
','
);
}
if
(
lexicon
!=
''
)
{
if
(
lexicon
.
contains
(
','
))
{
final
all
=
lexicon
.
split
(
','
);
var
tmp
=
<
String
>[];
for
(
final
f
in
all
)
{
tmp
.
add
(
p
.
join
(
directory
.
path
,
f
));
}
lexicon
=
tmp
.
join
(
','
);
}
else
if
(
lexicon
!=
''
)
{
lexicon
=
p
.
join
(
directory
.
path
,
modelDir
,
lexicon
);
}
...
...
@@ -148,6 +164,8 @@ Future<sherpa_onnx.OfflineTts> createOfflineTts() async {
voices:
voices
,
tokens:
tokens
,
dataDir:
dataDir
,
dictDir:
dictDir
,
lexicon:
lexicon
,
);
}
else
{
vits
=
sherpa_onnx
.
OfflineTtsVitsModelConfig
(
...
...
请
注册
或
登录
后发表评论