RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
text_to_speech.cpp
Go to the documentation of this file.
3 #include <boost/date_time/posix_time/posix_time.hpp>
4 #include <boost/thread/thread.hpp>
7 int main(int argc, char* argv[])
8 {
9  // service controler
11  std::vector<std::shared_ptr<rapp::cloud::asio_socket>> queue;
12 
13  // load the image from argv[1]
14  auto callback = [&](std::unique_ptr<rapp::object::microphone_wav> audio)
15  {
16  if(audio){
17  audio->save("audio.wav");
18  }
19  std::cout << "got reply\r\n";
20  };
21 
22  for (int i = 0; i < 10; i++){
23  //ctrl.run_job(fdetect);
24  auto fdetect = std::make_shared<rapp::cloud::text_to_speech>("hello kids",
25  "en_US",
26  "my_token",
27  callback);
28  queue.push_back(fdetect);
29  }
30  ctrl.run_jobs(queue);
31  ctrl.stop();
32 
33  return 0;
34 }
int main(int argc, char *argv[])
Main class that controllers RAPP Services.
void run_jobs(const std::vector< std::shared_ptr< asio_socket >> &jobs)
Run a group of jobs in a batch.
void stop()
stop the service controller