0
votes

I try to play white noise and record at the same time with two microphones which is connected to same sound card. I am using wavplay and wavrecord for simultaneous record and it is working for a single microphone. I don't know how to add second microphone to my code, i tried adding second wav record but it plotted the first record result. I hope I could explain the problem and can get some help.

    a= randn (1,44100);
    b = zeros (1, length (a)');
    c= [a;b];
    wavplay (c',44100,'async');
    r = wavrecord (length (c),44100,1,'int16');

this is for 1 mic and it is working. but i can't add second mic in that code. Thanks in advance

1

1 Answers

0
votes

I don't think wavrecord supports multiple devices. It's been deprecated in favor of audiorecorder.

Audio recorder takes an additional argument for the audio device

recorder = audiorecorder(Fs,nBits,nChannels,ID)

You can get the ID from the audiodevinfo command, see the docs.

If you run into trouble with devices, this article may help.