MATLAB: Interface microphones using matlab

microphonesoundcard

I have three microphones and i want to record the signals from the microphones simultaneously, is it possible in matlab?
i used the below mentioned program and i can acquire data from one microphone but im not able to get from all the three at the same time
clear all
close all
clc
AI = analoginput('winsound');
addchannel(AI, 1);
Fs = 8000;
set (AI, 'SampleRate', Fs)
duration = 20;
set(AI, 'SamplesPerTrigger', duration*Fs);
start(AI);
data = getdata(AI);
delete(AI)

Best Answer

Sorry mate, it looks like you are expecting the two-channel mic jack on your sound card to have three inputs.
Go and buy yourself a USB sound interface with 4 mic preamps.
The Alesis iO4 or Tascam US-600 are among the cheapest devices out there. Bonus is they will take a 5mm jack on all channels, since I assume you are not using professional microphones.
As for using only two microphones on one sound card, yes you should be able to do this. But you need to make a stereo splitter cable (or there may be something at your local electronics shop) which turns a single male stereo 3.5mm male jack into two mono 3.5mm female sockets (corresponding to left and right).
Plug that into your computer, and a mic into each of the sockets on the splitter. Then you should be able to at least record two mono channels (assuming that the mic input is stereo). You will, however, not have individual gain control on the two mics.
If you really do have more than one device, then you should be able to choose that device with your initial call to analoginput:
doc analoginput
It might not be 'winsound', and if it is, try the second parameter which selects the hardware ID.
Also, if you are using 64-bit MatLab, you need to read the documentation, which states that you can't use the analoginput interface.