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-01-20 11:41:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-01-20 11:41:59 +0800
Commit
e2f096bf3cf535f2ad75b4617810abb92663a2b1
e2f096bf
1 parent
9d6c0e55
Add iOS TTS example for MatchaTTS (#1736)
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
35 行增加
和
0 行删除
ios-swiftui/SherpaOnnxTts/SherpaOnnxTts/ViewModel.swift
ios-swiftui/SherpaOnnxTts/SherpaOnnxTts/ViewModel.swift
查看文件 @
e2f096b
...
...
@@ -127,9 +127,44 @@ func getTtsFor_zh_en_melo_tts() -> SherpaOnnxOfflineTtsWrapper {
return
SherpaOnnxOfflineTtsWrapper
(
config
:
&
config
)
}
func
getTtsFor_matcha_icefall_zh_baker
()
->
SherpaOnnxOfflineTtsWrapper
{
// please see https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-zh-baker-chinese-1-female-speaker
let
acousticModel
=
getResource
(
"model-steps-3"
,
"onnx"
)
let
vocoder
=
getResource
(
"hifigan_v2"
,
"onnx"
)
let
tokens
=
getResource
(
"tokens"
,
"txt"
)
let
lexicon
=
getResource
(
"lexicon"
,
"txt"
)
let
dictDir
=
resourceURL
(
to
:
"dict"
)
let
numFst
=
getResource
(
"number"
,
"fst"
)
let
dateFst
=
getResource
(
"date"
,
"fst"
)
let
phoneFst
=
getResource
(
"phone"
,
"fst"
)
let
ruleFsts
=
"
\(
dateFst
)
,
\(
phoneFst
)
,
\(
numFst
)
"
let
matcha
=
sherpaOnnxOfflineTtsMatchaModelConfig
(
acousticModel
:
acousticModel
,
vocoder
:
vocoder
,
lexicon
:
lexicon
,
tokens
:
tokens
,
dictDir
:
dictDir
)
let
modelConfig
=
sherpaOnnxOfflineTtsModelConfig
(
matcha
:
matcha
)
var
config
=
sherpaOnnxOfflineTtsConfig
(
model
:
modelConfig
,
ruleFsts
:
ruleFsts
)
return
SherpaOnnxOfflineTtsWrapper
(
config
:
&
config
)
}
func
createOfflineTts
()
->
SherpaOnnxOfflineTtsWrapper
{
// Please enable only one of them
// return getTtsFor_matcha_icefall_zh_baker()
return
getTtsFor_en_US_amy_low
()
// return getTtsForVCTK()
...
...
请
注册
或
登录
后发表评论