Fawkes API
Fawkes Development Version
|
SpeechSynthInterface Fawkes BlackBoard Interface. More...
#include <>>
Classes | |
class | SayMessage |
SayMessage Fawkes BlackBoard Interface Message. More... | |
struct | SpeechSynthInterface_data_t |
Internal data storage, do NOT modify! More... | |
Public Member Functions | |
virtual bool | message_valid (const Message *message) const |
Check if message is valid and can be enqueued. | |
char * | text () const |
Get text value. | |
void | set_text (const char *new_text) |
Set text value. | |
size_t | maxlenof_text () const |
Get maximum length of text value. | |
uint32_t | msgid () const |
Get msgid value. | |
void | set_msgid (const uint32_t new_msgid) |
Set msgid value. | |
size_t | maxlenof_msgid () const |
Get maximum length of msgid value. | |
bool | is_final () const |
Get final value. | |
void | set_final (const bool new_final) |
Set final value. | |
size_t | maxlenof_final () const |
Get maximum length of final value. | |
float | duration () const |
Get duration value. | |
void | set_duration (const float new_duration) |
Set duration value. | |
size_t | maxlenof_duration () const |
Get maximum length of duration value. | |
virtual Message * | create_message (const char *type) const |
Create message based on type name. | |
virtual void | copy_values (const Interface *other) |
Copy values from other interface. | |
virtual const char * | enum_tostring (const char *enumtype, int val) const |
Convert arbitrary enum value to string. |
SpeechSynthInterface Fawkes BlackBoard Interface.
The interface provides access to a spech synthesizer facility. On systems that support this feature strings can be ordered for synthesis and audio output. Multiple messages ordering speech should be enqueued and processed one after another by providers.
void fawkes::SpeechSynthInterface::copy_values | ( | const Interface * | other | ) | [virtual] |
Copy values from other interface.
other | other interface to copy values from |
Implements fawkes::Interface.
Definition at line 232 of file SpeechSynthInterface.cpp.
References fawkes::Message::type(), and fawkes::Interface::type().
Message * fawkes::SpeechSynthInterface::create_message | ( | const char * | type | ) | const [virtual] |
Create message based on type name.
This will create a new message of the given type. The type must be given without the InterfaceName:: prefix but just the plain class name of the message.
type | message type |
UnknownTypeException | thrown if this interface cannot create a message of the given type. |
Implements fawkes::Interface.
Definition at line 217 of file SpeechSynthInterface.cpp.
float fawkes::SpeechSynthInterface::duration | ( | ) | const |
Get duration value.
Length in seconds that it takes to speek the current text, -1 if unknown. This is the total duration of the current string, *not* the duration of already spoken or yet to speak text!
Definition at line 185 of file SpeechSynthInterface.cpp.
const char * fawkes::SpeechSynthInterface::enum_tostring | ( | const char * | enumtype, |
int | val | ||
) | const [virtual] |
Convert arbitrary enum value to string.
Given the string representation of the enum type and the value this method returns the string representation of the specific value, or the string UNKNOWN if the value is not defined. An exception is thrown if the enum type is invalid.
enumtype | enum type as string |
val | value to convert |
UnknownTypeException | thrown if enumtype is not specified for interface. |
Implements fawkes::Interface.
Definition at line 243 of file SpeechSynthInterface.cpp.
bool fawkes::SpeechSynthInterface::is_final | ( | ) | const |
Get final value.
True, if the last text has been spoken, false if it is still running.
Definition at line 148 of file SpeechSynthInterface.cpp.
size_t fawkes::SpeechSynthInterface::maxlenof_duration | ( | ) | const |
Get maximum length of duration value.
Definition at line 195 of file SpeechSynthInterface.cpp.
size_t fawkes::SpeechSynthInterface::maxlenof_final | ( | ) | const |
Get maximum length of final value.
Definition at line 158 of file SpeechSynthInterface.cpp.
size_t fawkes::SpeechSynthInterface::maxlenof_msgid | ( | ) | const |
Get maximum length of msgid value.
Definition at line 122 of file SpeechSynthInterface.cpp.
size_t fawkes::SpeechSynthInterface::maxlenof_text | ( | ) | const |
Get maximum length of text value.
Definition at line 86 of file SpeechSynthInterface.cpp.
bool fawkes::SpeechSynthInterface::message_valid | ( | const Message * | message | ) | const [virtual] |
Check if message is valid and can be enqueued.
message | Message to check |
Implements fawkes::Interface.
Definition at line 348 of file SpeechSynthInterface.cpp.
uint32_t fawkes::SpeechSynthInterface::msgid | ( | ) | const |
Get msgid value.
The ID of the message that is currently being processed, or 0 if no message is being processed.
Definition at line 112 of file SpeechSynthInterface.cpp.
void fawkes::SpeechSynthInterface::set_duration | ( | const float | new_duration | ) |
Set duration value.
Length in seconds that it takes to speek the current text, -1 if unknown. This is the total duration of the current string, *not* the duration of already spoken or yet to speak text!
new_duration | new duration value |
Definition at line 209 of file SpeechSynthInterface.cpp.
References fawkes::Interface::data_changed.
Referenced by FestivalSynthThread::say(), and FliteSynthThread::say().
void fawkes::SpeechSynthInterface::set_final | ( | const bool | new_final | ) |
Set final value.
True, if the last text has been spoken, false if it is still running.
new_final | new final value |
Definition at line 170 of file SpeechSynthInterface.cpp.
References fawkes::Interface::data_changed.
Referenced by FestivalSynthThread::say(), FliteSynthThread::say(), and NaoQiSpeechSynthThread::loop().
void fawkes::SpeechSynthInterface::set_msgid | ( | const uint32_t | new_msgid | ) |
Set msgid value.
The ID of the message that is currently being processed, or 0 if no message is being processed.
new_msgid | new msgid value |
Definition at line 135 of file SpeechSynthInterface.cpp.
References fawkes::Interface::data_changed.
Referenced by FestivalSynthThread::loop(), and FliteSynthThread::loop().
void fawkes::SpeechSynthInterface::set_text | ( | const char * | new_text | ) |
Set text value.
Last spoken string. Must be properly null-terminated.
new_text | new text value |
Definition at line 98 of file SpeechSynthInterface.cpp.
References fawkes::Interface::data_changed.
Referenced by FestivalSynthThread::say(), and FliteSynthThread::say().
char * fawkes::SpeechSynthInterface::text | ( | ) | const |
Get text value.
Last spoken string. Must be properly null-terminated.
Definition at line 76 of file SpeechSynthInterface.cpp.