30 input_buffer.
attach(m_inputPort);
64 if (
nullptr == m_isptr)
72 callback_impl = std::make_unique<SpeechSynthesizer_CallbackHelper>(m_isptr,&m_outputPort);
81bool SpeechSynthesizer_nws_yarp::detach()
87bool SpeechSynthesizer_nws_yarp::closeMain()
102 if (!connection.
isValid()) {
return false;}
104 bool b = m_rpc.
read(connection);
120 std::lock_guard <std::mutex>
lg(m_mutex);
127 ret.ret = ReturnValue::return_code::return_value_error_generic;
133 std::lock_guard <std::mutex>
lg(m_mutex);
137 std::string language;
140 ret.language = language;
144 ret.ret = ReturnValue::return_code::return_value_error_generic;
150 std::lock_guard <std::mutex>
lg(m_mutex);
162 std::lock_guard <std::mutex>
lg(m_mutex);
173 ret.ret = ReturnValue::return_code::return_value_error_generic;
179 std::lock_guard <std::mutex>
lg(m_mutex);
186 ret.ret = ReturnValue::return_code::return_value_error_generic;
192 std::lock_guard <std::mutex>
lg(m_mutex);
208 std::lock_guard <std::mutex>
lg(m_mutex);
215 ret.ret = ReturnValue::return_code::return_value_error_generic;
221 std::lock_guard <std::mutex>
lg(m_mutex);
232 ret.ret = ReturnValue::return_code::return_value_error_generic;
238 std::lock_guard <std::mutex>
lg(m_mutex);
250 m_output_port->
write(snd);
256 ret.ret = ReturnValue::return_code::return_value_error_generic;
264 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_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
Callback method.
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.
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 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 getPitch(double &voice)=0
Gets the current pitch set 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.
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.
An interface for reading from a network connection.
virtual bool isValid() const =0
void attach(Port &port)
Attach this buffer to a particular port.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
void disableCallback() override
Remove a callback set up with useCallback()
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,...)