From de7666110679d5a4bbc308c8e68d38a3b4ec7334 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Sun, 25 Jun 2023 15:19:47 -0500 Subject: [PATCH] More error logging for phoneme id map --- src/cpp/piper.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cpp/piper.cpp b/src/cpp/piper.cpp index ede7bbb..4af46e8 100644 --- a/src/cpp/piper.cpp +++ b/src/cpp/piper.cpp @@ -67,6 +67,14 @@ void parsePhonemizeConfig(json &configRoot, PhonemizeConfig &phonemizeConfig) { for (auto &fromPhonemeItem : phonemeIdMapValue.items()) { std::string fromPhoneme = fromPhonemeItem.key(); if (!isSingleCodepoint(fromPhoneme)) { + std::stringstream idsStr; + for (auto &toIdValue : fromPhonemeItem.value()) { + PhonemeId toId = toIdValue.get(); + idsStr << toId << ","; + } + + spdlog::error("\"{}\" is not a single codepoint (ids={})", fromPhoneme, + idsStr.str()); throw std::runtime_error( "Phonemes must be one codepoint (phoneme id map)"); } @@ -90,6 +98,7 @@ void parsePhonemizeConfig(json &configRoot, PhonemizeConfig &phonemizeConfig) { for (auto &fromPhonemeItem : phonemeMapValue.items()) { std::string fromPhoneme = fromPhonemeItem.key(); if (!isSingleCodepoint(fromPhoneme)) { + spdlog::error("\"{}\" is not a single codepoint", fromPhoneme); throw std::runtime_error( "Phonemes must be one codepoint (phoneme map)"); }