Add Kokoro v1.1-zh (#1942)

This commit is contained in:
Fangjun Kuang
2025-02-28 15:47:59 +08:00
committed by GitHub
parent f5dfcf8d2f
commit dfcbc8d40b
20 changed files with 897 additions and 61 deletions

View File

@@ -128,15 +128,19 @@ class KokoroMultiLangLexicon::Impl {
}
for (const auto &ids : ids_vec) {
if (ids.size() > 4) {
if (ids.size() > 10 + 2) {
ans.emplace_back(ids);
} else {
if (ans.empty()) {
ans.emplace_back(ids);
} else {
ans.back().tokens.back() = ids[1];
ans.back().tokens.insert(ans.back().tokens.end(), ids.begin() + 2,
ids.end());
if (ans.back().tokens.size() + ids.size() < 50) {
ans.back().tokens.back() = ids[1];
ans.back().tokens.insert(ans.back().tokens.end(), ids.begin() + 2,
ids.end());
} else {
ans.emplace_back(ids);
}
}
}
}

View File

@@ -33,8 +33,8 @@ GeneratedAudio GeneratedAudio::ScaleSilence(float scale) const {
if (scale == 1) {
return *this;
}
// if the interval is larger than 0.6 second, then we assume it is a pause
int32_t threshold = static_cast<int32_t>(sample_rate * 0.6);
// if the interval is larger than 0.2 second, then we assume it is a pause
int32_t threshold = static_cast<int32_t>(sample_rate * 0.2);
std::vector<SilenceInterval> intervals;
int32_t num_samples = static_cast<int32_t>(samples.size());