diff --git a/src/Sound/flitevoice.cxx b/src/Sound/flitevoice.cxx index 9766293..96c08ea 100644 --- a/src/Sound/flitevoice.cxx +++ b/src/Sound/flitevoice.cxx @@ -23,6 +23,9 @@ # include "config.h" #endif +#include + + #include "flitevoice.hxx" #include
#include @@ -64,7 +67,22 @@ void FGFLITEVoice::speak(const string & msg) // this is called from voice.cxx:FGVoiceMgr::FGVoiceThread::run string s = simgear::strutils::strip(msg); if (!s.empty()) { - _sampleQueue.push(_synthesizer->synthesize(msg, 1.0, 0.5, 0.5)); + + //zhonjin + //_sampleQueue.push(_synthesizer->synthesize(msg, 1.0, 0.5, 0.5)); + auto serverurl = fgGetString("/sim/sound/ttsurl"); + if (!serverurl.empty() && fgGetBool("/sim/sound/voices/enabled",true)) { + + SG_LOG(SG_SOUND, SG_INFO, "TTS Play '" << s << "'" ); + + string urlcmd = "ffplay -nodisp -autoexit -loglevel quiet -i "; + urlcmd.append("\""); + urlcmd.append(serverurl); + urlcmd.append("/speech/?str="); + urlcmd.append(msg); + urlcmd.append("\""); + system(urlcmd.c_str()); + } } }