function my_htk_write_le( data, par, output_filename )
  
  if nargin < 3
    error( [ mfilename ' needs 3 input arguments.' ] );
  end

  if any( isinf( data(:) ) | isnan( data(:) ) )
    error( [ mfilename ': data must NOT contain any NaN or Infs !' ] );
  end
  
  fid = fopen( output_filename, 'w', 'ieee-le' );
  
  % Write 12-byte HTK header
  
  n_frames = size( data, 2 );
  fwrite( fid, n_frames,       'int32' );
  
  period = par.FRAME_SHIFT_SEC * 1e7;
  fwrite( fid, period,         'int32' );
  
  size_of_sample = 4 * size( data, 1 );
  fwrite( fid, size_of_sample, 'int16' );
  
  HTK_Type = 9;  % USER
  fwrite( fid, HTK_Type,       'int16' );
  
  % Dump the data
  fwrite( fid, data,           'float32' );
  
  fclose( fid );
  