function seg = remove_speech_from_seg( in_seg, speech_min_dur_sec )

  % Check input arguments
  
  if nargin < 2
    error( 'remove_speech_from_seg: needs two input arguments !' );
  end
  
  if nargout < 1
    error( 'remove_speech_from_seg: needs one output argument !' );
  end
  
  if ~isnumeric( in_seg )
    error( 'remove_speech_from_seg: needs a 3xN matrix of TIME VALUES AND SPEECH/SILENCE INDICATORS for "in_seg" input argument !' );    
  end
  
  seg = in_seg;
  
  if isempty( in_seg )
    if ~strcmp( warning, 'off' )
      disp( 'remove_speech_from_seg: WARNING! empty input argument "in_seg".' );
    end
    return;
  end
    
  siz = size( in_seg );
  if siz( 1 ) ~= 3
    error( 'remove_speech_from_seg: needs a 3xN matrix of TIME VALUES AND SPEECH/SILENCE INDICATORS for "in_seg" input argument !' );    
  end
  
  %%%

  seg( 3,: ) = ~seg( 3,: );
  
  seg = remove_sil_from_seg( seg, speech_min_dur_sec );
  
  seg( 3,: ) = ~seg( 3,: );
  