RAPP Platform API
Main Page
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
text_to_speech.cpp
Go to the documentation of this file.
1
#include "
cloud/service_controller/service_controller.hpp
"
2
#include "
cloud/speech/text_to_speech/text_to_speech.hpp
"
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
10
rapp::cloud::service_controller
ctrl;
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
}
main
int main(int argc, char *argv[])
Definition:
text_to_speech.cpp:7
service_controller.hpp
rapp::cloud::service_controller
Main class that controllers RAPP Services.
Definition:
service_controller.hpp:20
rapp::cloud::service_controller::run_jobs
void run_jobs(const std::vector< std::shared_ptr< asio_socket >> &jobs)
Run a group of jobs in a batch.
Definition:
service_controller.cpp:19
text_to_speech.hpp
rapp::cloud::service_controller::stop
void stop()
stop the service controller
Definition:
service_controller.cpp:33
cpp
examples
text_to_speech.cpp
Generated on Fri Jul 29 2016 18:45:01 for RAPP Platform API by
1.8.6