Skip to content

Commit

Permalink
Allow overwriting voice model via config options
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jan 16, 2024
1 parent 78a857e commit a0218b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions programs/DialogueManager/DialogueManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ bool DialogueManager::configure(yarp::os::ResourceFinder & rf)
yInfo("\t--help (this help)\t--from [file.ini]\t--context [path]");
yInfo("\t--language: %s [%s]", language.c_str(), DEFAULT_LANGUAGE);
yInfo("\t--backend: %s [%s]", backend.c_str(), DEFAULT_BACKEND);
yInfo("\t--model: (specific for the chosen language and backend)");
return false;
}

Expand All @@ -73,7 +74,7 @@ bool DialogueManager::configure(yarp::os::ResourceFinder & rf)
return false;
}

voice = group.find("model").asString();
model = rf.check("model", group.find("model"), "voice model").asString();

for (const auto & label : sentenceLabels)
{
Expand Down Expand Up @@ -172,9 +173,9 @@ bool DialogueManager::close()

bool DialogueManager::threadInit()
{
if (!tts.setLanguage(voice))
if (!tts.setLanguage(model))
{
yError() << "Unable to set voice to" << voice;
yError() << "Unable to set model to" << model;
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion programs/DialogueManager/DialogueManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DialogueManager : public yarp::os::RFModule,
yarp::os::RpcClient speechPort;
yarp::os::RpcClient motionPort;

std::string voice;
std::string model;
std::unordered_map<std::string, std::string> sentences;

std::atomic<bool> demoCompleted {false};
Expand Down

0 comments on commit a0218b0

Please sign in to comment.