我们如何将ALAudioRecorder API应用到choregraphe应用程序中

问题描述:

我正试图将http://doc.aldebaran.com/2-4/naoqi/audio/alaudiorecorder-api.html#alaudiorecorder-api的ALAutioRecorder API代码应用到我的应用程序中,但我不确定如何去做。下面的代码是我不知道在哪里放置的代码它,因为我非常新的这个应用程序我们如何将ALAudioRecorder API应用到choregraphe应用程序中

#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; 
} 
+0

我不是这个模块的忠实粉丝,我听到有人抱怨丢失数据包。而且,你不能即时分析块。这就是为什么我的建议是使用这种模块:https://*.com/questions/24243757/nao-robot-remote-audio-problems/24699052#24699052 –

+0

@AlexandreMazel谢谢,会给它一个尝试 – Thibaut

如果你正在做内部Choregraphe行为,应该有一个盒子“录制声音”盒子库中,可能已经这样做了,你需要什么,或者至少给你一个好的开始。