1
0
Fork 0

Festival: Fix volume/pitch/speed after preamble

Fix from Antonello: when we send a premable to Festival, we need to
set the parameters afterwards. Re-order the code so this occurs
automatically.
This commit is contained in:
James Turner 2021-01-06 14:06:27 +00:00
parent a9323432d0
commit 06bd0708b9

View file

@ -171,16 +171,19 @@ FGFestivalVoice::FGFestivalVoice(FGVoiceMgr *mgr, const SGPropertyNode_ptr node)
SG_LOG(SG_SOUND, SG_INFO, "VOICE: connection to Festival server on `"
<< host << ':' << port << "' established");
setVolume(_volume = _volumeNode->getDoubleValue());
setPitch(_pitch = _pitchNode->getDoubleValue());
setSpeed(_speed = _speedNode->getDoubleValue());
}
string preamble = node->getStringValue("preamble", "");
if (!preamble.empty())
pushMessage(preamble);
node->getNode("text", true)->addChangeListener(this);
const string preamble = node->getStringValue("preamble", "");
if (!preamble.empty()) {
pushMessage(preamble);
}
// set these after sending any preamble, since it may reset them
setVolume(_volume = _volumeNode->getDoubleValue());
setPitch(_pitch = _pitchNode->getDoubleValue());
setSpeed(_speed = _speedNode->getDoubleValue());
node->getNode("text", true)->addChangeListener(this);
}