ALSoundRecognition
 All Classes Functions
alsoundrecognition.h
1 
7 #ifndef SOUNDPROCESSING_H
8 #define SOUNDPROCESSING_H
9 #include <string>
10 #include <rttools/rttime.h>
11 
12 #ifdef SOUNDPROCESSING_IS_REMOTE
13 #include <qi/application.hpp>
14 #include <boost/function.hpp>
15 #include <boost/bind.hpp>
16 #endif
17 
18 #include <boost/shared_ptr.hpp>
19 #include <alvalue/alvalue.h>
20 #include <alproxies/almemoryproxy.h>
21 #include <alaudio/alsoundextractor.h>
22 using namespace AL;
23 
24 class ALSoundRecognition : public ALSoundExtractor
25 {
26 
27 public:
28 
29  ALSoundRecognition(boost::shared_ptr<ALBroker> pBroker, std::string pName);
30  virtual ~ALSoundRecognition();
31 
32  //method inherited from almodule that will be called after constructor
33  void init();
34 
35 public:
36  void process(const int & nbOfChannels,
37  const int & nbrOfSamplesByChannel,
38  const AL_SOUND_FORMAT * buffer,
39  const ALValue & timeStamp);
40 
41  void startSession();
42 
43  void stopSession();
44 
45  void restartSession();
46 
47  int getStatus();
48 
49  std::string getResult();
50 
51  void restart();
52 
53 private:
54  ALMemoryProxy fProxyToALMemory;
55  std::vector<std::string> fALMemoryKeys;
56  void getMscResult();
57 
58  void endSession();
59 
60  void setStatus(int status);
61 
62  void throwError(int errorStatus);
63 };
64 #endif
65 
Definition: alsoundrecognition.h:24