我们如何将 ALAudioRecorder API 实现到 choregraphe 应用程序中
How do we implement ALAudioRecorder API into choregraphe application
我正在尝试将 http://doc.aldebaran.com/2-4/naoqi/audio/alaudiorecorder-api.html#alaudiorecorder-api 中的 ALAutioRecorder API 代码实施到我的应用程序中,但我不太确定该怎么做 so.The 下面的代码是我不知道的放在哪里,因为我对这个应用程序还很陌生
#include <iostream>
#include <alproxies/alaudiorecorderproxy.h>
#include <qi/os.hpp>
int main(int argc, char **argv)
{
if (argc < 2) {
std::cerr << "Usage: alaudiorecorder_startrecording pIp"
<< std::endl;
return 1;
}
const std::string pIp = argv[1];
AL::ALAudioRecorderProxy proxy(pIp);
/// Configures the channels that need to be recorded.
AL::ALValue channels;
channels.arrayPush(0); //Left
channels.arrayPush(0); //Right
channels.arrayPush(1); //Front
channels.arrayPush(0); //Rear
/// Starts the recording of NAO's front microphone at 16000Hz
/// in the specified wav file
proxy.startMicrophonesRecording("/home/nao/test.wav", "wav", 16000, channels);
qi::os::sleep(5);
/// Stops the recording and close the file after 10 seconds.
proxy.stopMicrophonesRecording();
return 0;
}
如果您在 Choregraphe 中进行行为,那么框库中应该有一个框 "Record Sound",它可能已经完成了您需要的操作,或者至少为您提供了一个良好的开端。
我正在尝试将 http://doc.aldebaran.com/2-4/naoqi/audio/alaudiorecorder-api.html#alaudiorecorder-api 中的 ALAutioRecorder API 代码实施到我的应用程序中,但我不太确定该怎么做 so.The 下面的代码是我不知道的放在哪里,因为我对这个应用程序还很陌生
#include <iostream>
#include <alproxies/alaudiorecorderproxy.h>
#include <qi/os.hpp>
int main(int argc, char **argv)
{
if (argc < 2) {
std::cerr << "Usage: alaudiorecorder_startrecording pIp"
<< std::endl;
return 1;
}
const std::string pIp = argv[1];
AL::ALAudioRecorderProxy proxy(pIp);
/// Configures the channels that need to be recorded.
AL::ALValue channels;
channels.arrayPush(0); //Left
channels.arrayPush(0); //Right
channels.arrayPush(1); //Front
channels.arrayPush(0); //Rear
/// Starts the recording of NAO's front microphone at 16000Hz
/// in the specified wav file
proxy.startMicrophonesRecording("/home/nao/test.wav", "wav", 16000, channels);
qi::os::sleep(5);
/// Stops the recording and close the file after 10 seconds.
proxy.stopMicrophonesRecording();
return 0;
}
如果您在 Choregraphe 中进行行为,那么框库中应该有一个框 "Record Sound",它可能已经完成了您需要的操作,或者至少为您提供了一个良好的开端。