function data = mydataread(filename)
% This function will read data from an audio file
% The current setting only works for wav file.
% 
% For mp3 files,
% (1) You can download Open-sourced tool Audacity to convert mp3 file as wave.
%       http://audacity.sourceforge.net/
%
% (2) If you want to read mp3 directly, download a third-party mp3read module from either of the following links:
%       http://www.mathworks.com/matlabcentral/fileexchange/6152
%       http://www.ee.columbia.edu/~dpwe/resources/matlab/fileexchange/mp3readwrite/html/demo_mp3readwrite.html
%       (modules ¡°mpg123¡± and ¡°lame¡± are required for mp3 decoding/encoding.)


[data, f] = wavread(filename);  % read data, f is the sample rate
data = data(:,1);  % For audio signal with two channels, only use the first channel
