MATLAB: How to check Number of channels of a sound file and convert stereo file in mono in MATLAB

mononumber of channelsstereo

I want to check whether the .wav file is stereo or mono.If it is stereo, convert in mono using MATLAB.How to proceed

Best Answer

Hemangi - try using audioread as
myWavFile = 'some.wav';
[y,Fs] = audioread(myWavFile);
From audioread y output argument, y will be an m-by-n matrix, where m is the number of audio samples read and n is the number of audio channels in the file. So if n is greater than one, then you have multiple channels.