classdef PEAQAudioMetricItem < FFMPEGDecoderAudioMetricItem
    
    properties
    
    end
    
     methods 
         function obj=PEAQAudioMetricItem
             obj=obj@FFMPEGDecoderAudioMetricItem('PEAQ');
         end
         
         
         function m=calc_audio_metric(obj,y1,y2,fs)
             
              y1 = resample(y1,48000,fs);
              y2 = resample(y2,48000,fs);
             
               wavwrite(y1,48000,16,'decodedaudio/ref.wav');
               wavwrite(y2,48000,16,'decodedaudio/comp.wav');
               
               m=PQevalAudio ('decodedaudio/ref.wav', 'decodedaudio/comp.wav');
               
         end
    end
    
    
    
end