function AP = audioPower(s,fs,framelength,noOfFrame)
totalTime = size(s) / fs;
frameTime = totalTime/noOfFrame;
y=buffer(s,framelength);  %the frame length is 10ms
        
for i = 1:noOfFrame

    totalPower(i) = 0;
    ap(i) = 0;
    for j = 1: (framelength)
        totalPower(i) = totalPower(i) + s(j + framelength*(i-1)) * s(j + framelength*(i-1));
    end;     
end;

ap= totalPower / framelength;
b = 0:frameTime:(totalTime-frameTime);
AP = [ap' b'];