
% Read in an audio file


function [audiodata, info] = readaudiochunk(info)

fprintf(1,'reading audio chunk\n');

% read in wav file

[rawdata, info.fs] = wavread(info.filename,[info.startsample info.endsample]);

info.fsdownsampled = info.fs;

% take average of stereo signals to give one mono audio vector

meandata = mean(rawdata,2);

% normalise audio
if max(meandata) > 0.00001
    audiodata = meandata/max(meandata);
else
    audiodata = meandata;
end

    
    



