Festival Synthesis Thread. More...
#include "synth_thread.h"
Public Member Functions | |
FestivalSynthThread () | |
Constructor. | |
virtual void | init () |
virtual void | finalize () |
virtual void | once () |
virtual void | loop () |
void | say (const char *text) |
Say something. | |
virtual bool | bb_interface_message_received (fawkes::Interface *interface, fawkes::Message *message) throw () |
BlackBoard message received notification. | |
Protected Member Functions | |
virtual void | run () |
Stub to see name in backtrace for easier debugging. |
Festival Synthesis Thread.
This thread synthesises audio for text-to-speech using Festival.
Definition at line 40 of file synth_thread.h.
FestivalSynthThread::FestivalSynthThread | ( | ) |
Constructor.
Definition at line 40 of file synth_thread.cpp.
bool FestivalSynthThread::bb_interface_message_received | ( | fawkes::Interface * | interface, | |
fawkes::Message * | message | |||
) | throw () [virtual] |
BlackBoard message received notification.
This is called whenever a message is received for this interface. This method is only called for writing instances of an interface, never on reading instances. If you have processed the message already, you can order that the message is not enqueued by returning false. Returning true will enqueue the message as usual. You should only do very (very!) quick tasks directly in this method, as it is out of the regular thread context and can harm performance of other plugins and the system as a whole. Note that if you decide to return false the message is not referenced. If you want to keep it longer you have to ref() it by yourself. An example where this would really make sense is a "STOP" message for the motor, which needs to be processed ASAP and maybe even waiting a couple of miliseconds for the next cycle is not acceptable.
interface | interface instance that you supplied to bbil_add_message_interface() | |
message | the message that was sent |
Reimplemented from fawkes::BlackBoardInterfaceListener.
Definition at line 119 of file synth_thread.cpp.
virtual void FestivalSynthThread::run | ( | ) | [inline, protected, virtual] |
Stub to see name in backtrace for easier debugging.
Definition at line 61 of file synth_thread.h.
void FestivalSynthThread::say | ( | const char * | text | ) |
Say something.
text | text to synthesize and speak. |
Definition at line 131 of file synth_thread.cpp.
References fawkes::ClockAspect::clock, fawkes::Clock::get_systime(), fawkes::SpeechSynthInterface::set_duration(), fawkes::SpeechSynthInterface::set_final(), fawkes::SpeechSynthInterface::set_text(), fawkes::Time::wait_systime(), and fawkes::Interface::write().