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-07-28 00:58:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-07-28 00:58:27 +0800
Commit
2bc632d650b901a56a0f65cf21912096ec12238b
2bc632d6
1 parent
9252f161
Add friendly log messages for Android and HarmonyOs TTS users. (#2427)
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
32 行增加
和
0 行删除
sherpa-onnx/csrc/jieba.cc
sherpa-onnx/csrc/piper-phonemize-lexicon.cc
sherpa-onnx/csrc/jieba.cc
查看文件 @
2bc632d
...
...
@@ -5,6 +5,7 @@
#include "sherpa-onnx/csrc/jieba.h"
#include "sherpa-onnx/csrc/file-utils.h"
#include "sherpa-onnx/csrc/macros.h"
namespace
sherpa_onnx
{
...
...
@@ -19,6 +20,21 @@ std::unique_ptr<cppjieba::Jieba> InitJieba(const std::string &dict_dir) {
std
::
string
idf
=
dict_dir
+
"/idf.utf8"
;
std
::
string
stop_word
=
dict_dir
+
"/stop_words.utf8"
;
#if __ANDROID_API__ >= 9 || defined(__OHOS__)
if
(
dict
[
0
]
!=
'/'
)
{
SHERPA_ONNX_LOGE
(
"You need to follow our examples to copy the jieba dict directory from "
"the assets folder to an external storage directory"
);
SHERPA_ONNX_LOGE
(
"Hint: Please see
\n
"
"https://github.com/k2-fsa/sherpa-onnx/blob/master/android/"
"SherpaOnnxTtsEngine/app/src/main/java/com/k2fsa/sherpa/onnx/tts/"
"engine/TtsEngine.kt#L193
\n
"
"The function copyDataDir()
\n
"
);
}
#endif
AssertFileExists
(
dict
);
AssertFileExists
(
hmm
);
AssertFileExists
(
user_dict
);
...
...
sherpa-onnx/csrc/piper-phonemize-lexicon.cc
查看文件 @
2bc632d
...
...
@@ -247,6 +247,22 @@ static std::vector<int64_t> CoquiPhonemesToIds(
void
InitEspeak
(
const
std
::
string
&
data_dir
)
{
static
std
::
once_flag
init_flag
;
std
::
call_once
(
init_flag
,
[
data_dir
]()
{
#if __ANDROID_API__ >= 9 || defined(__OHOS__)
if
(
data_dir
[
0
]
!=
'/'
)
{
SHERPA_ONNX_LOGE
(
"You need to follow our examples to copy the espeak-ng-data "
"directory from the assets folder to an external storage directory."
);
SHERPA_ONNX_LOGE
(
"Hint: Please see
\n
"
"https://github.com/k2-fsa/sherpa-onnx/blob/master/android/"
"SherpaOnnxTtsEngine/app/src/main/java/com/k2fsa/sherpa/onnx/tts/"
"engine/TtsEngine.kt#L188
\n
"
"The function copyDataDir()
\n
"
);
}
#endif
int32_t
result
=
espeak_Initialize
(
AUDIO_OUTPUT_SYNCHRONOUS
,
0
,
data_dir
.
c_str
(),
0
);
if
(
result
!=
22050
)
{
...
...
请
注册
或
登录
后发表评论