23 #include "synth_thread.h"
25 #include <interfaces/SpeechSynthInterface.h>
26 #include <utils/time/wait.h>
28 #include <festival/festival.h>
30 using namespace fawkes;
41 :
Thread(
"FestivalSynthThread",
Thread::OPMODE_WAITFORWAKEUP),
58 __cfg_extra_code =
"";
71 festival_initialize( 1, FESTIVAL_HEAP_SIZE);
72 if (__cfg_voice !=
"") {
73 std::string voice_cmd =
"(voice_" + __cfg_voice +
")";
74 if (! festival_eval_command(voice_cmd.c_str())) {
79 if (__cfg_extra_code !=
"") {
81 if (! festival_eval_command(__cfg_extra_code.c_str())) {
86 say(
"Festival speech synth loaded");
134 festival_text_to_wave(text, wave);
136 float duration = (float)wave.num_samples() / (float)wave.sample_rate();
141 __speechsynth_if->
write();
153 float remaining = duration - (now - &
start);
155 Time waittime(remaining);
160 __speechsynth_if->
write();