void FestivalSynthesizer::run() { ros::NodeHandle node_handle; subscriber_ = node_handle.subscribe( "robot_face/text_out", 1, &FestivalSynthesizer::callbackSynth, this ); // Subscribe to ROS message talking_finished_publisher_ = node_handle.advertise<std_msgs::String>( "robot_face/talking_finished", 1 ); while( ros::ok() ) { ros::getGlobalCallbackQueue()->callOne( ros::WallDuration( 3 ) ); if( synth_speech_ ) { synthSpeech( text_for_synth_ ); festival_wait_for_spooler(); std_msgs::String msg; std::stringstream string_stream; string_stream << "talking_finished"; msg.data = string_stream.str(); talking_finished_publisher_.publish( msg ); synth_speech_ = false; } } }
int main(void) { EST_Wave wave; int heap_size = 210000; // default scheme heap size int load_init_files = 1; // we want the festival init files loaded festival_initialize(load_init_files,heap_size); //festival_say_file("/etc/issue.text"); //festival_eval_command("(voice_msu_ru_nsh_clunits)"); //festival_say_text("а"); festival_eval_command("(voice_ked_diphone)"); festival_say_text("privet, suchka. blyahui"); festival_text_to_wave("hello world",wave); wave.save("/tmp/wave.wav","riff"); // festival_say_file puts the system in async mode so we better // wait for the spooler to reach the last waveform before exiting // This isn't necessary if only festival_say_text is being used (and // your own wave playing stuff) festival_wait_for_spooler(); return 0; }
/** Say a message * @param msg * the message to say * @return 0 */ int tts_say(const char *msg) { if (!voice_selected) { tts_select_voice("voice_kal_diphone"); } festival_say_text(msg); festival_wait_for_spooler(); return 0; }
/** Say a message * @param msg * the message to say * @return 0 */ int tts_say(const char *msg) { if (!voice_selected) { // tts_select_voice("voice_cmu_us_slt_arctic_hts"); tts_select_voice("voice_kal_diphone"); } festival_say_text(msg); festival_wait_for_spooler(); return 0; }
extern void voice_wait() { festival_wait_for_spooler(); }
// Bloquea la ejecución hasta que se acabe de decir todo. Importante llamar a esto al // final del programa. void speech_close() { festival_wait_for_spooler(); }
void TTS::waitForSpooler() { festival_wait_for_spooler(); }