Clean up and fix append

This commit is contained in:
Michael Hansen
2023-09-09 17:05:28 -05:00
parent 6011a8673d
commit 137fa67db9
3 changed files with 49 additions and 42 deletions

View File

@@ -117,7 +117,8 @@ int main(int argc, char *argv[]) {
GetModuleFileNameW(nullptr, moduleFileName, std::size(moduleFileName));
return filesystem::path(moduleFileName);
}();
#elifdef __APPLE__
#else
#ifdef __APPLE__
auto exePath = []() {
char moduleFileName[PATH_MAX] = {0};
uint32_t moduleFileNameSize = std::size(moduleFileName);
@@ -126,6 +127,7 @@ int main(int argc, char *argv[]) {
}();
#else
auto exePath = filesystem::canonical("/proc/self/exe");
#endif
#endif
if (voice.phonemizeConfig.phonemeType == piper::eSpeakPhonemes) {

View File

@@ -482,7 +482,7 @@ void textToAudio(PiperConfig &config, Voice &voice, std::string text,
// DEBUG log for phonemes
std::string phonemesStr;
for (auto phoneme : sentencePhonemes) {
utf8::append(phoneme, &phonemesStr);
utf8::append(phoneme, std::back_inserter(phonemesStr));
}
spdlog::debug("Converting {} phoneme(s) to ids: {}",
@@ -596,7 +596,7 @@ void textToAudio(PiperConfig &config, Voice &voice, std::string text,
for (auto phonemeCount : missingPhonemes) {
std::string phonemeStr;
utf8::append(phonemeCount.first, &phonemeStr);
utf8::append(phonemeCount.first, std::back_inserter(phonemeStr));
spdlog::warn("Missing \"{}\" (\\u{:04X}): {} time(s)", phonemeStr,
(uint32_t)phonemeCount.first, phonemeCount.second);
}