MATLAB: Modifying the example “Read from Microphone and Write to Audio File”. Help!

Audio Toolboxaudiodevicereader audiofire12DSP System Toolbox

Best Answer

Hi Nuri,
You code looks fine on the surface and this should indeed work with no issues. Since you are using channel #2 as input, can I double-check that you tried setting that on the object? You can use either of
deviceReader.NumChannels = 2;
or
deviceReader.ChannelMapping = 2;
The first will return a Nx2 matrix, the second only a N-long column vector if you keep NumChannels equal to 1. Please let us know how this goes.
Good luck!
Gabriele.