function [] = get_Formants( dirName, statsFileID )

% this function collates the results of all values calculated using the PRAAT software 

% For jitter and shimmer PRAAT returns only a single value, not a
% frame-by-frame calculation. Therefore we cannot find the varience etc.


    % identify the speaker in the stats file
    fprintf( statsFileID, '%s ', dirName );
    
    
%-------------- get the formant metrics ----------------------        
% PRAAT returns a frame-by-frame value  
    % need to discard all formant information for unvoiced and silent frames.
    vuv = detect_VoicedUnvoiced( [dirName '.wav'], 0 );
    
    metricName = '_Formant_Burg';
    metricFileName = [ dirName metricName '.txt'];
    readFormantValueFromFile( statsFileID, metricFileName, metricName, vuv );
    
    metricName = '_Formant_all';
    metricFileName = [ dirName metricName '.txt'];
    readFormantValueFromFile( statsFileID, metricFileName, metricName, vuv );
    
    metricName = '_Formant_robust';
    metricFileName = [ dirName metricName '.txt'];
    readFormantValueFromFile( statsFileID, metricFileName, metricName, vuv );
    
    
    fprintf( statsFileID, '\n');
    
    