Record audio simultaneously from two kinect sensors at same time on MATLAB?

Hello i need to record sound using kinect's microphones on matlab but i want to record using two kinects.. When i record using two kinects they have latency of almost 1 second between them. it seems like first kinect works for first second(time) and swap to second kinect for second second(time). i mean if i record for 2 seconds then first second only one kinect works and another one for next second.
maybe they spend one second to swap between two kinects like swapping between two channels.
so i need to record at same time.. is it possible?
my code is:
k1 = dsp.AudioRecorder('DeviceName','Microphone Array (Kinect USB Audio)',...
'NumChannels',4,'SampleRate',16000,'SamplesPerFrame',16000,'OutputDataType','single');
k2 = dsp.AudioRecorder('DeviceName','Microphone Array (2- Kinect USB Audio)',...
'NumChannels',4,'SampleRate',16000,'SamplesPerFrame',16000,'OutputDataType','single');
f = figure(1);
lim = 0.5;
while (true)
key = get(f,'CurrentCharacter');
if (key == 'e')
break;
else
audio1 = step(k1);
audio2 = step(k2);
ch11 = audio1(:,1);
ch21 = audio2(:,1);
ch14 = audio1(:,4);
ch24 = audio2(:,4);
subplot(411);plot(ch11,'r');ylim([-lim lim]);
subplot(412);plot(ch14,'m');ylim([-lim lim]);
subplot(413);plot(ch21,'b');ylim([-lim lim]);
subplot(414);plot(ch24,'g');ylim([-lim lim]);
drawnow;
end
release(k1);
release(k2);
clear ch11 ch21 ch14 ch24
end

Answers (0)

Asked:

on 13 Jan 2014

Edited:

on 13 Jan 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!