8#include <yarp/dev/DeviceDriver.h>
9#include <yarp/os/Thread.h>
10#include <yarp/os/Stamp.h>
11#include <yarp/os/Property.h>
12#include <yarp/os/RpcServer.h>
13#include <yarp/os/ResourceFinder.h>
14#include <yarp/dev/PolyDriver.h>
19#include <Speech_IDL.h>
36class yarp::dev::Speech :
public yarp::dev::DeviceDriver,
37 public yarp::os::Thread,
45 virtual bool open(yarp::os::Searchable &config);
49 virtual bool setLanguage(
const std::string& language);
51 virtual bool say(
const std::string& text);
52 virtual bool setSpeed(
const int16_t speed);
53 virtual bool setPitch(
const int16_t pitch);
61 virtual bool threadInit();
63 virtual void threadRelease();
71 const std::string renderSpeech(
const std::string& text);
72 bool playWav(
const std::string& filename);
75 yarp::os::Property config;
76 yarp::os::RpcServer rpcPort;
78 std::string pcmDevice;
80 std::vector<std::string> supportedLangs;
85 pico_System picoSystem;
86 pico_Resource picoTaResource;
87 pico_Resource picoSgResource;
88 pico_Resource picoUtppResource;
89 pico_Engine picoEngine;
90 pico_Char * picoTaFileName;
91 pico_Char * picoSgFileName;
92 pico_Char * picoUtppFileName;
93 pico_Char * picoTaResourceName;
94 pico_Char * picoSgResourceName;
95 pico_Char * picoUtppResourceName;
97 yarp::os::ResourceFinder lingwareRF;
virtual bool say(const std::string &text)
render and play the speech
virtual std::vector< std::string > getSupportedLang()
get the available languages
virtual int16_t getPitch()
get the speech pitch
virtual int16_t getSpeed()
get the speech speed
virtual bool setPitch(const int16_t pitch)
set the speech pitch
virtual bool play()
play the previously rendered or paused speech
virtual bool setLanguage(const std::string &language)
set the speech langauge
virtual bool stop()
stop playing the current speech
virtual bool setSpeed(const int16_t speed)
set the speech speed
virtual bool pause()
pause the current speech