// file: dec_input_3.cc
//
 
// isip include files
//
#include "decoder.h"
#include "decoder_constants.h"

// method: read_features_cc
//
// arguments:
//  FILE* fp: (input) file pointer
//  
// return: a logical_1 indicating status
//
// this method reads in the HTK header from file
//
logical_1 Decoder::read_htk_header_cc(FILE* fp_a) {
  
  // HTK header variables
  //
  int_4 n_samples = (int_4)0;
  int_4 samp_period = (int_4)0;
  int_2 samp_size = (int_2)0;
  int_2 samp_kind = (int_2)0;
  
  fseek (fp_a, 0L, SEEK_SET);
  
  if (!fread (&n_samples, sizeof(int_4), 1, fp_a)) {
    error_handler_cc((char_1*)"dec_input_0.cc", (char_1*)"No. of Samples not specified in HTK Header file");
    return ISIP_FALSE;
  }
  
  if (!fread (&samp_period, sizeof(int_4), 1, fp_a)) {
    error_handler_cc((char_1*)"dec_input_0.cc", (char_1*)"Sampling Peroid not specified in HTK Header file");
    return ISIP_FALSE;
  }
  
  if (!fread (&samp_size, sizeof(int_2), 1, fp_a)) {
    error_handler_cc((char_1*)"dec_input_0.cc", (char_1*)"Sampling size notspecified in HTK Header file");
    return ISIP_FALSE;
  }
  
  if (!fread (&samp_kind, sizeof(int_2), 1, fp_a)) {
    error_handler_cc((char_1*)"dec_input_0.cc", (char_1*)"Sampling kind not specified in HTK Header file");
    return ISIP_FALSE;
  }
  
  return ISIP_TRUE;
}
