RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
set_denoise_example.cpp
Go to the documentation of this file.
13 int main(int argc, char ** argv)
14 {
15  if (argc == 4)
16  {
17  std::cout << "denoise file: " << argv[1] << std::endl;
18  std::string file = argv[1];
19  std::cout << "audio source: " << argv[2] << std::endl;
20  std::string type = argv[2];
21  std::cout << "denoise user: " << argv[3] << std::endl;
22  std::string user = argv[3];
23  std::string token = "my_token";
24 
26  std::shared_ptr<rapp::object::audio> audio;
27 
28  if (type == "microphone_wav")
29  audio = std::make_shared<rapp::object::microphone_wav>(file);
30  else if (type == "nao_single_channel_wav")
31  audio = std::make_shared<rapp::object::nao_single_channel_wav>(file);
32  else if (type == "nao_quad_channel_wav")
33  audio = std::make_shared<rapp::object::nao_quad_channel_wav>(file);
34  else if (type == "ogg")
35  audio = std::make_shared<rapp::object::ogg>(file);
36  else
37  throw std::runtime_error("uknown audio source");
38 
39  if (audio) {
40  ctrl.run_job(std::make_shared<rapp::cloud::set_denoise_profile>(audio, user, token));
41  }
42  }
43  else
44  std::cerr << "incorrect params" << std::endl;
45 
46  return 0;
47 }
Main class that controllers RAPP Services.
int main(int argc, char **argv)
void run_job(const std::shared_ptr< asio_socket > job)
Run one service job.