| 375 | } |
| 376 | |
| 377 | int64_t approximate_phoneme_count(const std::string & text, const std::string & language) { |
| 378 | if (language == "en") { |
| 379 | int64_t count = 0; |
| 380 | for (const unsigned char ch : text) { |
| 381 | if (is_ascii_alpha(ch) || (ch >= '0' && ch <= '9')) { |
| 382 | ++count; |
| 383 | } |
| 384 | } |
| 385 | return std::max<int64_t>(count, 1); |
| 386 | } |
| 387 | return std::max<int64_t>(static_cast<int64_t>(engine::text::utf8_codepoint_count(text, "MioTTS best_of_n text")), 1); |
| 388 | } |
| 389 | |
| 390 | double punctuation_bonus_seconds(const std::string & text) { |
| 391 | double bonus = 0.0; |
no test coverage detected