19 #ifndef __ICUBCLIENT_SUBSYSTEM_SPEECH_H__ 20 #define __ICUBCLIENT_SUBSYSTEM_SPEECH_H__ 22 #define SUBSYSTEM_SPEECH "speech" 23 #define SUBSYSTEM_SPEECH_ESPEAK "speech_espeak" 56 virtual void TTS(
const std::string &
text,
bool shouldWait =
true);
94 speed = (std::max)(80, speed);
95 speed = (std::min)(450, speed);
96 pitch = (std::max)(0, pitch);
97 pitch = (std::min)(99, pitch);
100 std::stringstream ss;
101 ss <<
"-s " << speed <<
" -p " << pitch <<
" -v " << voice;
102 yarp::os::Bottle param;
103 param.addString(
"set");
104 param.addString(
"opt");
105 param.addString(ss.str().c_str());
Abstract subSystem for speech management (Text to Speech)
virtual void TTS(const std::string &text, bool shouldWait=true)
Produce text to speech output.
yarp::os::RpcClient portRPC
Abstract class to handle sub-systems of the icub-client.
SubSystem_Speech(const std::string &masterName)
Default constructor.
yarp::os::Port tts
Port to /iSpeak.
void SetVoiceParameters(int speed=100, int pitch=50, std::string voice="en")
SubSystem for speech synthesis with emotional tuning of speed and pitch using eSpeak.
void SetOptions(const std::string &custom)
Set the command line options sent by iSpeak.
bool isSpeaking()
Check if iSpeak is currently speaking.
#define SUBSYSTEM_SPEECH_ESPEAK
virtual void Close()
Clean up resources.
SubSystem_Speech_eSpeak(std::string &masterName)