26 #define _BABTTSDYN_IMPL_
27 #include "ifBabTtsDyn.h"
28 #undef _BABTTSDYN_IMPL_
31 int main(
int argc,
char *argv[])
33 std::string voice=
"iCub_eng";
37 std::cout<<
"Voice is: "<<voice<<std::endl;
39 std::string textInput;
40 std::getline(std::cin,textInput);
41 std::cout<<
"Text is: "<<textInput<<std::endl;
44 if (BabTtsInitDllEx(_T(
"."))==NULL)
46 std::cerr<<
"Error: Could not load AcaTTS"<<std::endl;
52 std::cerr<<
"Error: Could not initialize AcaTTS"<<std::endl;
57 lpEngine=BabTTS_Create();
60 std::cerr<<
"Error: Could not create AcaTTS context"<<std::endl;
66 if (BabTTS_Open(lpEngine,voice.c_str(),0)!=E_BABTTS_NOERROR)
68 std::cerr<<
"Error: Could not open "<<voice<<std::endl;
69 BabTTS_Close(lpEngine);
77 int speed=atoi(argv[2]);
78 BabTTS_SetSettings(lpEngine,BABTTS_PARAM_SPEED,speed);
83 int pitchMultiplier=atoi(argv[3]);
84 BabTTS_SetSettings(lpEngine,BABTTS_PARAM_PITCH,pitchMultiplier);
87 BabTTS_Speak(lpEngine,textInput.c_str(),BABTTS_SYNC|BABTTS_TAG_SAPI);
89 BabTTS_Close(lpEngine);