WavPlayerService_impl.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <cstdlib>
3 #include <cstdio>
4 #include <pthread.h>
5 #include "hrpsys/util/Hrpsys.h"
7 
8 
10 {
11 }
12 
14 {
15 }
16 
17 void WavPlayerService_impl::playWav(const char *filename)
18 {
19  char buf[256];
20  sprintf(buf, "aplay %s", filename);
21  std::cout << "cmd = [" << buf << "]" << std::endl;
22  int ret = system(buf);
23 }
24 
25 void *thread_main(void *args)
26 {
27  char *filename = (char *)args;
28  char buf[256];
29  sprintf(buf, "aplay %s", filename);
30  std::cout << "cmd = [" << buf << "]" << std::endl;
31  int ret = system(buf);
32  return NULL;
33 }
34 
35 void WavPlayerService_impl::playWavNoWait(const char *filename)
36 {
37  pthread_t thr;
38  pthread_create(&thr, NULL, thread_main, (void *)filename);
39 }
char * filename
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
void playWav(const char *filename)
void * thread_main(void *args)
void playWavNoWait(const char *filename)
png_bytep buf
std::string sprintf(char const *__restrict fmt,...)


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:51