Install HTK and HTS source files

tar -zxvf HTK-3.4.1.tar.gz

tar -zxvf HDecode-3.4.1.tar.gz

The HTK source files will be in the htk file folder. Then apply HTS-2.3_for_HTK-3.4.1.patch for HTK-3.4.1 as follows. First copy the HTS-2.3_for_HTK-3.4.1.patch to the htk folder, then cd htk and

patch -p1 -d . < HTS-2.3_for_HTK-3.4.1.patch

Then add the libf2c link to my local library /user/abc/lib

I generated the link because otherwise I will get an error of "libf2c.so: undefined reference to `MAIN__'", so probably the libf2c.so is broken in the /usr/lib folder.

ln -s /usr/lib/libf2c.a /user/abc/lib/libf2c.so

Then do the configuration as follows where "/usr/lib/x86_64-linux-gnu" contains libX11.a and libm.a, which will be used for certain HTK tools

./configure --prefix=/user/abc/HTS-2.3 LDFLAGS="-L/usr/lib/x86_64-linux-gnu -L/user/abc/lib"

Finally generate the executable files in the preset folder of /user/abc/HTS-2.3/bin

make

make install

Test HTK

Download and unzip the HTK-samples-3.4.1.tar.gz somewhere

tar xzf HTK-samples-3.4.1.tar.gz

cd samples

cd HTKDemo

Go to bash shell and generate folders proto acc test hmms/tmp, hmms/hmm.0, hmms/hmm.1.....

bash

mkdir –p hmms/{tmp,hmm.{0,1,2,3}} proto acc test

Add htk directory of /user/abc/HTS-2.3 to the PATH

PATH="$PATH:/user/cvsspstf/ql0002/HTS-2.3/bin:."

export PATH

Do some changes to MakeProtoHMMSet to solve the following error (If HTK was installed without the HTS patch, the error won't come up) :

HMM Def Error: <Mean> symbol expected in GetMean at line 6/col 11/char 120 in proto/L

ERROR [+7050] HMError:

HMM Def Error: GetMean Failed at line 6/col 12/char 121 in proto/L

ERROR [+7050] HMError:

HMM Def Error: Regression Class Number expected at line 7/col 0/char 122 in proto/L

ERROR [+7050] HMError:

HMM Def Error: GetMixtures failed at line 7/col 1/char 123 in proto/L

ERROR [+7050] HMError:

HMM Def Error: Get Stream Information failed at line 7/col 2/char 124 in proto/L

ERROR [+7050] HMError:

HMM Def Error: GetStream failed at line 7/col 3/char 125 in proto/L

ERROR [+7050] HMError:

HMM Def Error: GetStateInfo failed at line 7/col 4/char 126 in proto/L

ERROR [+7050] HMError:

ERROR [+7032] LoadHMMSet: GetHMMDef failed

ERROR [+2128] Initialise: LoadHMMSet failed

FATAL ERROR - Terminating program HInit

Source Directory Empty hmms/hmm.0

The reason is explained here

#----------------------------------------------

# WriteStates: Write the contents of the states

#----------------------------------------------

sub WriteStates {

local($i,$j)=0;

for ($i=1; $i<=$nStates; $i++){

printf(PROTO " <State> %d\n",$i+1);

# for ($k=1; $k<=$nStreams; $k++){z

# printf(PROTO "%d ",$mixes[$k]);

# }

# printf(PROTO "\n");

for ($j=1; $j<=$nStreams; $j++){

printf(PROTO " <Stream> %d\n",$j);

printf(PROTO " <NumMixes> %d\n",$mixes[$j]);

if ($hsKind =~ /^[Dd]/){

&WriteDProbs($j);

}elsif ($hsKind =~ /^[pP]/){

if ($cKind =~ /^[dD]/){

&WriteDiagCMixtures($j);

}else{

&WriteFullCMixtures($j);

}

}elsif ($hsKind =~ /^[Tt]/){

&WriteTiedWghts($j);

}

}

}

}

Finally run the test

perl runDemo configs/monPlainM1S1.dcf

And got the message

====================== HTK Results Analysis =======================

Date: Fri Jun 9 14:59:06 2017

Ref : labels/bcplabs/mon

Rec : test/te1.rec

: test/te2.rec

: test/te3.rec

------------------------ Overall Results --------------------------

SENT: %Correct=0.00 [H=0, S=3, N=3]

WORD: %Corr=63.91, Acc=59.40 [H=85, D=35, S=13, I=6, N=133]

===================================================================