63 if (
nullptr == m_isptr)
71 callback_impl = std::make_unique<SpeechSynthesizer_CallbackHelper>(m_isptr,&m_outputPort);
80bool SpeechSynthesizer_nws_yarp::detach()
86bool SpeechSynthesizer_nws_yarp::closeMain()
101 if (!connection.
isValid()) {
return false;}
103 bool b = m_rpc.
read(connection);
119 std::lock_guard <std::mutex>
lg(m_mutex);
126 ret.
ret = ReturnValue::return_code::return_value_error_generic;
132 std::lock_guard <std::mutex>
lg(m_mutex);
136 std::string language;
143 ret.
ret = ReturnValue::return_code::return_value_error_generic;
149 std::lock_guard <std::mutex>
lg(m_mutex);
161 std::lock_guard <std::mutex>
lg(m_mutex);
172 ret.
ret = ReturnValue::return_code::return_value_error_generic;
178 std::lock_guard <std::mutex>
lg(m_mutex);
189 ret.
ret = ReturnValue::return_code::return_value_error_generic;
195 std::lock_guard <std::mutex>
lg(m_mutex);
202 ret.
ret = ReturnValue::return_code::return_value_error_generic;
208 std::lock_guard <std::mutex>
lg(m_mutex);
224 std::lock_guard <std::mutex>
lg(m_mutex);
231 ret.
ret = ReturnValue::return_code::return_value_error_generic;
237 std::lock_guard <std::mutex>
lg(m_mutex);
248 ret.
ret = ReturnValue::return_code::return_value_error_generic;
254 std::lock_guard <std::mutex>
lg(m_mutex);
272 ret.
ret = ReturnValue::return_code::return_value_error_generic;
280 if (x ==
nullptr || p==
nullptr)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual return_set_pitch set_pitch(double pitch) override
virtual return_get_pitch get_pitch() override
virtual return_set_language set_language(const std::string &language) override
virtual return_get_speed get_speed() override
virtual return_get_voice get_voice() override
virtual return_get_available_voices get_available_voices() override
virtual return_get_language get_language() override
virtual return_set_speed set_speed(double speed) override
virtual return_set_voice set_voice(const std::string &language) override
void setOutputPort(yarp::os::Port *port)
void setInterfaces(yarp::dev::ISpeechSynthesizer *iser)
virtual return_synthesize synthesize(const std::string &text) override
yarp::os::Port * m_output_port
SpeechSynthesizer_CallbackHelper()=delete
void onRead(yarp::os::Bottle &b) override
yarp::dev::ISpeechSynthesizer * m_isptr
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
void run() override
Main body of the new thread.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual ~SpeechSynthesizer_nws_yarp() override
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue ret
yarp::sig::VectorOfString available_voices
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
A generic interface for speech synthesis.
virtual yarp::dev::ReturnValue synthesize(const std::string &text, yarp::sig::Sound &sound)=0
Performs the speech synthesis.
virtual yarp::dev::ReturnValue setPitch(const double pitch)=0
Sets the pitch for speech synthesis.
virtual yarp::dev::ReturnValue setVoice(const std::string &voice_name="auto")=0
Sets the voice set for speech synthesis.
virtual yarp::dev::ReturnValue setSpeed(const double speed=0)=0
Sets the voice speed for speech synthesis.
virtual yarp::dev::ReturnValue getAvailableVoices(yarp::sig::VectorOfString &available_voices)=0
Returns the list of available voices for the currently set language.
virtual yarp::dev::ReturnValue getLanguage(std::string &language)=0
Gets the current language set for speech synthesis.
virtual yarp::dev::ReturnValue setLanguage(const std::string &language="auto")=0
Sets the language for speech synthesis.
virtual yarp::dev::ReturnValue getSpeed(double &speed)=0
Gets the current voice speed.
virtual yarp::dev::ReturnValue getVoice(std::string &voice_name)=0
Gets the current voice set for speech synthesis.
virtual yarp::dev::ReturnValue getPitch(double &pitch)=0
Gets the current pitch set for speech synthesis.
A container for a device driver.
A simple collection of objects that can be described and transmitted in a portable way.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
void disableCallback() override
Remove a callback set up with useCallback()
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
An interface for reading from a network connection.
virtual bool isValid() const =0
A mini-server for network communication.
int getOutputCount() override
Determine how many output connections this port has.
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
void setReader(PortReader &reader) override
Set an external reader for port data.
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.
static void delaySystem(double seconds)
bool stop()
Stop the thread.
bool isStopping()
Returns true if the thread is stopping (Thread::stop has been called).
bool isRunning()
Returns true if the thread is running (Thread::start has been called successfully and the thread has ...
bool start()
Start the new thread running.
virtual std::string asString() const
Get string value.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)