HTK format files consist of a contiguous sequence of samples preceded by a header. Each sample is a vector of either 2-byte integers or 4-byte floats. 2-byte integers are used for compressed forms as described below and for vector quantised data as described later in section 5.11. HTK format data files can also be used to store speech waveforms as described in section 5.8.
The HTK file format header is 12 bytes long and contains the following data
nSamples - number of samples in file (4-byte integer)
sampPeriod - sample period in 100ns units (4-byte integer)
sampSize - number of bytes per sample (2-byte integer)
parmKind - a code indicating the sample kind (2-byte integer)
if (hdr.sampSize <= 0 || hdr.sampSize > 5000 || hdr.nSamples <= 0 ||
hdr.sampPeriod <= 0 || hdr.sampPeriod > 1000000)