8 #include <alproxies/almemoryproxy.h>
9 #include <alcommon/alproxy.h>
10 #include <alcommon/albroker.h>
23 functionName(
"setDebugMode",
25 "enable/disable the printing of some debug information");
26 addParam(
"bSetOrUnset",
27 "enable the functionnality when true.");
30 functionName(
"processRemote",
32 "enable/disable the printing of some debug information");
33 addParam(
"nbOfChannels",
34 "Provides the number of channels of the buffer.");
35 addParam(
"nbOfSamplesByChannel",
36 "Provides the number of samples by channel.");
38 "Provides the timestamp of the buffer.");
40 "Provides the audio buffer as an ALValue.");
41 BIND_METHOD(ALSoundExtractor::processRemote);
43 functionName(
"processSoundRemote",
45 "enable/disable the printing of some debug information");
46 addParam(
"nbOfChannels",
47 "Provides the number of channels of the buffer.");
48 addParam(
"nbOfSamplesByChannel",
49 "Provides the number of samples by channel.");
51 "Provides the audio buffer as an ALValue.");
57 audioDevice = getParentBroker()->getProxy(
"ALAudioDevice");
59 catch(
const ALError& e)
61 qiLogWarning(
"audio.alsoundextractor") << e.what()
62 <<
" Sound capture will not work.";
79 qiLogVerbose(
"audio.alsoundextractor",
"ALSoundExtractor : startDetection");
83 audioDevice = getParentBroker()->getProxy(
"ALAudioDevice");
84 audioDevice->callVoid(
"subscribe", this->getName());
86 catch(ALError & error)
89 throw ALError(getName(),
"startDetection", error.what());
100 qiLogVerbose(
"audio.alsoundextractor",
"ALSoundExtractor : stopDetection");
102 audioDevice->callVoid(
"unsubscribe", this->getName());
107 const int & nbrOfSamplesByChannel,
109 const ALValue & timestamp)
115 processSound(nbOfChannels, nbrOfSamplesByChannel, buffer);
119 const int pNbrSamples,
125 const int & pNbrSamples,
126 const ALValue & pBuffer)
131 void ALSoundExtractor::processRemote(
const int & pNbOfInputChannels,
132 const int & pNbrSamples,
133 const ALValue & timestamp,
134 const ALValue & buffer)
146 std::vector<std::string> ALSoundExtractor::getOutputNames(
void)
148 return getParentBroker()->getProxy(
"ALMemory")->
149 call<std::vector<std::string> >(
"getExtractorEvent", getName());