libsent/src/anlz/rdparam.c File Reference

Read HTK parameter file. More...

#include <sent/stddefs.h>
#include <sent/htk_param.h>
#include <sys/types.h>

Include dependency graph for rdparam.c:

Go to the source code of this file.

Functions

static boolean myread (char *buf, size_t unitbyte, int unitnum, FILE *fp)
static boolean read_param (FILE *fp, HTK_Param *pinfo)
HTK_Paramnew_param ()
void free_param (HTK_Param *pinfo)
boolean rdparam (char *filename, HTK_Param *pinfo)

Variables

static boolean needswap
 TRUE if need byte-swapping.


Detailed Description

Read HTK parameter file.

Author:
Akinobu LEE
Date:
Tue Feb 15 00:16:44 2005
The byte order of HTK parameter file is assumed as big endian. If not, however, these functions try to read with forcing byte (re-)swapping.

When "_C" (compressed) or "_K" (CRC checksum added) exists in the file, they are processed in these functions. Then, after reading finished, these qualifiers are removed from its parameter type code.

Revision
1.3

Definition in file rdparam.c.


Function Documentation

static boolean myread ( char *  buf,
size_t  unitbyte,
int  unitnum,
FILE *  fp 
) [static]

Read binary data from a file pointer, with byte swapping.

Parameters:
buf [out] buffer to store read data
unitbyte [in] size of a unit in bytes
unitnum [in] number of unit to read
fp [in] file pointer
Returns:
TRUE if specified number of unit was successfully read, FALSE if failed.

Definition at line 60 of file rdparam.c.

static boolean read_param ( FILE *  fp,
HTK_Param pinfo 
) [static]

Read in a HTK parameter file from fp .

Parameters:
fp [in] file pointer
pinfo [in] parameter data to store the read informations
Returns:
TRUE on success, FALSE on failure.

Definition at line 82 of file rdparam.c.

Referenced by rdparam().

HTK_Param* new_param (  ) 

Allocate a new parameter.

Returns:
pointer to the newly allocated area.

Definition at line 197 of file rdparam.c.

Referenced by init_param(), main_recognition_loop(), new_select_param_kind(), and new_wav2mfcc().

void free_param ( HTK_Param pinfo  ) 

Free the HTK parameter structure.

Parameters:
pinfo [in] parameter data to be destroyed.

Definition at line 212 of file rdparam.c.

Referenced by main_recognition_loop(), new_param_check_and_adjust(), and RealTimeTerminate().

boolean rdparam ( char *  filename,
HTK_Param pinfo 
)

Top function to read a HTK parameter file.

Parameters:
filename [in] HTK parameter file name
pinfo [in] parameter data (already allocated by new_param())
Returns:
TRUE on success, FALSE on failure.

Definition at line 233 of file rdparam.c.

Referenced by main_recognition_loop().


Generated on Tue Dec 26 16:17:43 2006 for Julius by  doxygen 1.5.0