在Matlab中是否有从多个麦克风获取音频信号的工作方式?

在Matlab中是否有从多个麦克风获取音频信号的工作方式?,matlab,signal-processing,microphone,Matlab,Signal Processing,Microphone,我想在Matlab(2012a)中同时获取多个USB麦克风。然而,两种录音功能都是短腿的。 1,recordblocking()-它允许用户指定录制的持续时间,但每个麦克风必须按顺序录制。所以我不知道如何让它同时录音。 2,record()-允许用户同时记录多个信号,但仅运行1秒(大致) 我使用的代码如下: recObj1 = audiorecorder(44100, 16, 1, 1); recObj2 = audiorecorder(44100, 16, 1, 3); disp('Start

我想在Matlab(2012a)中同时获取多个USB麦克风。然而,两种录音功能都是短腿的。 1,
recordblocking()
-它允许用户指定录制的持续时间,但每个麦克风必须按顺序录制。所以我不知道如何让它同时录音。 2,
record()
-允许用户同时记录多个信号,但仅运行1秒(大致)

我使用的代码如下:

recObj1 = audiorecorder(44100, 16, 1, 1);
recObj2 = audiorecorder(44100, 16, 1, 3);
disp('Start speaking.')
% recordblocking(recObj1, n);
% recordblocking(recObj2, n);
disp('Real recording.')
% by the way, the following function doesn't take 'on' as the second argument as opposed to what the internal/external documentation says
record(recObj1, 1);
record(recObj2, 1);

disp('End of Recording.');

所以基本上,我无法实现n秒长的多个麦克风输入的同时录音。请提供帮助。

您显然已经阅读了此文档,它是关于从端口记录数据的:

这是录音机的录音功能:

第二个输入参数是持续时间。

尝试以下操作:

%records from speaker IDs 0 (probably internal microphone) & 3,
%using audiorecorder function. 

recobj1 = audiorecorder(22500,16,2,0);
recobj2 = audiorecorder(22500,16,2,3);

disp('start speaking.')
record(recobj1,5);
record(recobj2,5);

recordblocking(recobj1,5);
%recordblocking(recobj3,2);

disp('end of recording');

y1 = getaudiodata(recobj1);
wavwrite(y1,22500,16,'recobj1');

y2 = getaudiodata(recobj2);
wavwrite(y2,22500,16,'recobj2');

plot(y1)
plot(y2)
它还可以绘制您的结果。放大以查看两个麦克风输出之间的差异