function [HNR] = detect_MFCC( sampleWavFileName, OVERWRITE )

sampleFileName = sampleWavFileName( 1 : length( sampleWavFileName ) - 4 );
[x, fs, frameLength, noOfFrames] = openFile( sampleWavFileName );

%---------------- GET THE SILENT FRAME VALUES -------------------

% only wish to consider pitch values from voiced frames.
% silent and unvoiced frames will produce pitch values that
% are random and therefore will bias our results

segmentFrames = detect_Silence( sampleWavFileName, 0 );
[ silentFrames ] = getSilentDataArray( segmentFrames, noOfFrames );

% open original calculation
fileName = [ sampleFileName '_MFCC.txt'];
fileID = fopen( fileName );

if(( fileID <= 0 ) || ( OVERWRITE )) %does the file exist?
    % no
    disp('WARNING: MISSING MFCC FILE');
    %calculate it
    mfcc = calculate_MFCC( x, fs, frameLength, noOfFrames );
    
    fileID = fopen( fileName, 'w');
    for i = 1 : (noOfFrames-1) 
        if( silentFrames(i) == 1 )
            % frame is not silent
            fprintf(fileID, '%d %s \n' , i, num2str( mfcc(:,i)' ));
        else
            % set to zero 
            mfcc(:,i) = 0;
        end
    end
    fclose( fileID );
    fileID = fopen( fileName );
end


mfcc = fscanf( fileID, '%f', inf );
mfcc = buffer(mfcc,14);     %   13 MFCC values and one frame number
mfcc = mfcc(2:14,:)';

fclose(fileID);
