32 std::string thriftClientPortName =
m_local +
"/thrift:c";
33 std::string thriftServerPortName =
m_remote +
"/rpc";
37 yCError(SPEECHSYNTH_NWC) <<
"open() failed: could not open" << thriftClientPortName <<
"check the network";
44 yCError(SPEECHSYNTH_NWC) <<
"Network::connect() failed: could not connect" << thriftClientPortName <<
"with" << thriftServerPortName;
51 yCError(SPEECHSYNTH_NWC) <<
"Error! Cannot attach the m_thriftClientPort (" << thriftClientPortName <<
") port as a client";
59bool SpeechSynthesizer_nwc_yarp::closeMain()
72 yCError(SPEECHSYNTH_NWC) <<
"Error while setting language to" << language;
84 yCError(SPEECHSYNTH_NWC) <<
"Error while retrieving language";
88 language = result.language;
95 auto result = m_thriftClient.
set_voice(voice_name);
98 yCError(SPEECHSYNTH_NWC) <<
"Error while setting voice to" << voice_name;
107 auto result = m_thriftClient.
get_voice();
110 yCError(SPEECHSYNTH_NWC) <<
"Error while retrieving the voice name";
114 voice_name = result.voice;
121 auto result = m_thriftClient.
set_speed(speed);
124 yCError(SPEECHSYNTH_NWC) <<
"Error while setting voice speed to" << speed;
133 auto result = m_thriftClient.
get_speed();
136 yCError(SPEECHSYNTH_NWC) <<
"Error while retrieving the voice speed";
140 speed = result.speed;
147 auto result = m_thriftClient.
set_pitch(pitch);
150 yCError(SPEECHSYNTH_NWC) <<
"Error while setting voice pitch to" << pitch;
159 auto result = m_thriftClient.
get_pitch();
162 yCError(SPEECHSYNTH_NWC) <<
"Error while retrieving the voice pitch";
166 pitch = result.pitch;
173 auto result = m_thriftClient.
synthesize(text);
176 yCError(SPEECHSYNTH_NWC) <<
"Error while performing voice synthesis";
179 sound = result.sound;
virtual return_set_speed set_speed(const double speed)
virtual return_get_speed get_speed()
virtual return_set_pitch set_pitch(const double pitch)
virtual return_set_voice set_voice(const std::string &language)
virtual return_synthesize synthesize(const std::string &text)
virtual return_get_pitch get_pitch()
virtual return_get_language get_language()
virtual return_get_voice get_voice()
virtual return_set_language set_language(const std::string &language)
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
yarp::dev::ReturnValue synthesize(const std::string &text, yarp::sig::Sound &sound) override
Performs the speech synthesis.
yarp::dev::ReturnValue setSpeed(const double speed=0) override
Sets the voice speed for speech synthesis.
yarp::dev::ReturnValue getPitch(double &pitch) override
Gets the current pitch set for speech synthesis.
~SpeechSynthesizer_nwc_yarp() override
yarp::dev::ReturnValue getSpeed(double &speed) override
Gets the current voice speed.
yarp::dev::ReturnValue setLanguage(const std::string &language="auto") override
Sets the language for speech synthesis.
yarp::dev::ReturnValue setPitch(const double pitch) override
Sets the pitch for speech synthesis.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue setVoice(const std::string &voice_name="auto") override
Sets the voice set for speech synthesis.
yarp::os::Port m_thriftClientPort
yarp::dev::ReturnValue getLanguage(std::string &language) override
Gets the current language set for speech synthesis.
yarp::dev::ReturnValue getVoice(std::string &voice_name) override
Gets the current voice set for speech synthesis.
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A base class for nested structures that can be searched.
bool attachAsClient(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a client, sending data via the specified port.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.