2017-06-01 73 views
0

我正試圖將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://stackoverflow.com/questions/24243757/nao-robot-remote-audio-problems/24699052#24699052 –

+0

@AlexandreMazel謝謝,會給它一個嘗試 – Thibaut

回答

0

如果你正在做內部Choregraphe行爲,應該有一個盒子「錄製聲音」盒子庫中,可能已經這樣做了,你需要什麼,或者至少給你一個好的開始。

相關問題