Skip to content
EBezerra edited this page Jun 21, 2017 · 8 revisions

HTK can be set up on Windows using the guide provided here.

Here is more detail on each step:

Microsoft Visual Studio

First, you'll need to install Microsoft Visual Studio. This can be downloaded from Microsoft. Choose Microsoft Visual Studio Professional 2013 with Update 2 (as of June 14, 2014). There is a 30-day or 90-day trial available, or if you are a student with a .edu email address, you can also register and download it for free on the same site.

  • (November 2014) Visual Studio is now available free to everyone here

Adding Visual Studio to your PATH

Next, you need to add Visual Studio to your PATH environment variable.

First, look for the VC\bin directory in your VS installation. It should be at the location C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin. If there's no (x86) or if you installed a different version (other than 12), be sure to use the correct location when you're using commands below.

Open a command prompt by pressing the Windows key and typing cmd.exe (on Vista or later), or by choosing "Run" from the Start Menu and type cmd (on earlier versions).

Type path into the command prompt and it should return your PATH variable (PATH= followed by a list of directories). To temporarily add VS to your PATH variable, type the following command.

set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

Type path again, and it should return the same list of directories as before, but with the string ;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin added to the very end. If it returns anything else (e.g., if it only returns the VC\bin directory), don't proceed to the next step (close the command prompt window and start over). If it returns the same list plus your VS directory, you can add VS permanently by using the setx command instead of set:

setx PATH "%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin"

On Windows XP, you'll need to install the Windows XP SP2 Support Tools before you can do this.

Run VCVARS32

In the command prompt, type vcvars32 and press enter. It should run for a few seconds and return nothing.

Troubleshooting

If vcvars32 returns an error message:

'vcvars32' is not recognized as an internal or external command, operable program or batch file.

Be sure that you added the correct VC\bin directory to your PATH.

ERROR: Cannot determine the location of the VS Common Tools folder.

You'll need to add C:/Windows/System32 to your PATH environment variable. Type reg /? to be sure that it worked --- it should return usage instructions, and not a is not recognized error.

\Microsoft was unexpected at this time. (or another was unexpected at this time message)

There might be double-quoted paths in your PATH variable --- you'll need to remove the quotes. The easiest way to do this on Windows 7 is to click the Start Menu, right-click Computer, and select Properties. On the left sidebar, click Advanced System Settings, choose the Advanced tab, then click Environment Variables... at the bottom.

There are two places you need to check. In the top section (User variables), select the Path variable, and then click Edit.... A box will pop up with two fields. Look through the Variable value field for directory paths that are surrounded by double-quotes (e.g., "C:\Program Files (x86)\sox-14-4-1"). Remove the double-quotes surrounding these paths, but don't change anything else. Press OK to close the box. In the bottom section (System variables), scroll down and click on the Path variable there, then click Edit... and remove any double-quotes surrounding any of the directory paths in the Variable value field. Be careful not to change anything else. Press OK to close the variable box, then again to close Environment variables, and then again to close System Properties.

Downloading and fixing HTK

You'll need to register (free) with HTK to download it. Visit http://htk.eng.cam.ac.uk/register.shtml to register, and they will e-mail you a password.

Download the file HTK source code (zip archive for Windows users) from here: http://htk.eng.cam.ac.uk/download.shtml with the username and password that you registered.

Unzip the contents and put them in a directory that won't change (e.g., a C:\Users\YourUserName\htk folder). Before installing HTK, you'll need to fix it using these instructions: http://github.com/JoFrhwld/FAVE/wiki/HTK-3.4.1#fixing-htk-source

Installing HTK

Open a command prompt and navigate to the folder where you unzipped HTK (e.g., cd C:\Users\YourUserName\htk). Here the steps are the same as the guide on the HTK site.

Once you're in the htk directory, type these commands to compile HTK:

mkdir bin.win32
cd HTKLib
nmake /f htk_htklib_nt.mkf all
cd ../HTKTools
nmake /f htk_htktools_nt.mkf all
cd ../HLMLib
nmake /f htk_hlmlib_nt.mkf all
cd ../HLMTools
nmake /f htk_hlmtools_nt.mkf all

Adding HTK to your PATH

Finally, you need to add C:\Users\YourUserName\htk\bin.win32 to your PATH variable.