YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

FakeSpeechSynthesizer: A fake implementation of a speech synthesizer plugin. More...

#include <fake/fakeSpeechSynthesizer/FakeSpeechSynthesizer.h>

+ Inheritance diagram for FakeSpeechSynthesizer:

Public Member Functions

 FakeSpeechSynthesizer ()
 
virtual ~FakeSpeechSynthesizer ()
 
 FakeSpeechSynthesizer (const FakeSpeechSynthesizer &)=delete
 
 FakeSpeechSynthesizer (FakeSpeechSynthesizer &&)=delete
 
FakeSpeechSynthesizeroperator= (const FakeSpeechSynthesizer &)=delete
 
FakeSpeechSynthesizeroperator= (FakeSpeechSynthesizer &&)=delete
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
virtual yarp::dev::ReturnValue setLanguage (const std::string &language) override
 Sets the language for speech synthesis.
 
virtual yarp::dev::ReturnValue getLanguage (std::string &language) override
 Gets the current language set for speech synthesis.
 
virtual yarp::dev::ReturnValue setVoice (const std::string &voice) override
 Sets the voice set for speech synthesis.
 
virtual yarp::dev::ReturnValue getVoice (std::string &voice) override
 Gets the current voice set for speech synthesis.
 
virtual yarp::dev::ReturnValue setSpeed (const double speed) override
 Sets the voice speed for speech synthesis.
 
virtual yarp::dev::ReturnValue getSpeed (double &voice) override
 Gets the current voice speed.
 
virtual yarp::dev::ReturnValue setPitch (const double pitch) override
 Sets the pitch for speech synthesis.
 
virtual yarp::dev::ReturnValue getPitch (double &voice) override
 Gets the current pitch set for speech synthesis.
 
virtual yarp::dev::ReturnValue synthesize (const std::string &text, yarp::sig::Sound &sound) override
 Performs the speech synthesis.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::ISpeechSynthesizer
virtual ~ISpeechSynthesizer ()
 
- Public Member Functions inherited from FakeSpeechSynthesizer_ParamsParser
 FakeSpeechSynthesizer_ParamsParser ()
 
 ~FakeSpeechSynthesizer_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Additional Inherited Members

- Public Attributes inherited from FakeSpeechSynthesizer_ParamsParser
const std::string m_device_classname = {"FakeSpeechSynthesizer"}
 
const std::string m_device_name = {"fakeSpeechSynthesizer"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_language_defaultValue = {"auto"}
 
const std::string m_voice_defaultValue = {"auto"}
 
const std::string m_speed_defaultValue = {"0.0"}
 
const std::string m_pitch_defaultValue = {"0.0"}
 
std::string m_language = {"auto"}
 
std::string m_voice = {"auto"}
 
double m_speed = {0.0}
 
double m_pitch = {0.0}
 

Detailed Description

FakeSpeechSynthesizer: A fake implementation of a speech synthesizer plugin.

Parameters required by this device are shown in class: FakeSpeechSynthesizer_ParamsParser

Definition at line 25 of file FakeSpeechSynthesizer.h.

Constructor & Destructor Documentation

◆ FakeSpeechSynthesizer() [1/3]

FakeSpeechSynthesizer::FakeSpeechSynthesizer ( )

Definition at line 22 of file FakeSpeechSynthesizer.cpp.

◆ ~FakeSpeechSynthesizer()

FakeSpeechSynthesizer::~FakeSpeechSynthesizer ( )
virtual

Definition at line 26 of file FakeSpeechSynthesizer.cpp.

◆ FakeSpeechSynthesizer() [2/3]

FakeSpeechSynthesizer::FakeSpeechSynthesizer ( const FakeSpeechSynthesizer )
delete

◆ FakeSpeechSynthesizer() [3/3]

FakeSpeechSynthesizer::FakeSpeechSynthesizer ( FakeSpeechSynthesizer &&  )
delete

Member Function Documentation

◆ close()

bool FakeSpeechSynthesizer::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 38 of file FakeSpeechSynthesizer.cpp.

◆ getLanguage()

ReturnValue FakeSpeechSynthesizer::getLanguage ( std::string &  language)
overridevirtual

Gets the current language set for speech synthesis.

Parameters
languagethe returned string (code) representing the speech language (e.g. ita, eng...). Default value is "auto".
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 50 of file FakeSpeechSynthesizer.cpp.

◆ getPitch()

ReturnValue FakeSpeechSynthesizer::getPitch ( double voice)
overridevirtual

Gets the current pitch set for speech synthesis.

Parameters
pitchthe current voice pitch.
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 89 of file FakeSpeechSynthesizer.cpp.

◆ getSpeed()

ReturnValue FakeSpeechSynthesizer::getSpeed ( double speed)
overridevirtual

Gets the current voice speed.

Parameters
speedthe current voice speed.
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 76 of file FakeSpeechSynthesizer.cpp.

◆ getVoice()

ReturnValue FakeSpeechSynthesizer::getVoice ( std::string &  voice_name)
overridevirtual

Gets the current voice set for speech synthesis.

Parameters
voice_namethe currently used voice (device dependent).
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 63 of file FakeSpeechSynthesizer.cpp.

◆ open()

bool FakeSpeechSynthesizer::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 31 of file FakeSpeechSynthesizer.cpp.

◆ operator=() [1/2]

FakeSpeechSynthesizer & FakeSpeechSynthesizer::operator= ( const FakeSpeechSynthesizer )
delete

◆ operator=() [2/2]

FakeSpeechSynthesizer & FakeSpeechSynthesizer::operator= ( FakeSpeechSynthesizer &&  )
delete

◆ setLanguage()

ReturnValue FakeSpeechSynthesizer::setLanguage ( const std::string &  language)
overridevirtual

Sets the language for speech synthesis.

Parameters
languagea string (code) representing the speech language (e.g. ita, eng...). Default value is "auto".
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 43 of file FakeSpeechSynthesizer.cpp.

◆ setPitch()

ReturnValue FakeSpeechSynthesizer::setPitch ( const double  pitch)
overridevirtual

Sets the pitch for speech synthesis.

Parameters
pitchthe voice pitch.
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 82 of file FakeSpeechSynthesizer.cpp.

◆ setSpeed()

ReturnValue FakeSpeechSynthesizer::setSpeed ( const double  speed)
overridevirtual

Sets the voice speed for speech synthesis.

Parameters
speedthe voice speed.
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 69 of file FakeSpeechSynthesizer.cpp.

◆ setVoice()

ReturnValue FakeSpeechSynthesizer::setVoice ( const std::string &  voice_name)
overridevirtual

Sets the voice set for speech synthesis.

Parameters
voice_namethe name of of the voice (device dependent).
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 56 of file FakeSpeechSynthesizer.cpp.

◆ synthesize()

ReturnValue FakeSpeechSynthesizer::synthesize ( const std::string &  text,
yarp::sig::Sound sound 
)
overridevirtual

Performs the speech synthesis.

Parameters
textthe text to synthesize
soundthe synthesized audio stream
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechSynthesizer.

Definition at line 95 of file FakeSpeechSynthesizer.cpp.


The documentation for this class was generated from the following files: