Click here to register.

Windows: Download Cygwin, HTK, Julius and Audacity

 Click here for the Linux version of this How-to

Cygwin

Cygwin is a Linux-like environment for Windows.  It contains the Bash Shell scripting language and the Perl scripting language.  Both are required to run the HTK Acoustic Model build scripts. 

Step 1 - Download Cygwin

  1. Go to http://www.cygwin.com/;
  2. Download the latest version of the cygwin setup application (click the 'Install Cygwin now' button on the top right-hand side of the web page).
Note: that this is not the full Cygwin application.  It is just the setup application that lets your download Cygwin from the Internet;

Step 2- Install Cygwin

  • Double-click the Cygwin setup application;
  • Follow the steps in the setup wizard:

Select install from the Internet:

Select Your Internet Connection - 'Direct Connection' should work OK;

Use the default local package directory:

On the Choose Installation Directory Window:
  • install your root directory to c:\cygwin (don't install to your Windows 'Program Files' directory ... Cywin has problems with spaces in directory or file names);
  • select install for 'All users';
  • select 'Unix/binary' Default Test File Type;

Choose a Download Site;

When the Select Packages window appears:
  1. click Perl,
  2. then select the following packages that are under Perl (click on the word 'skip' on the same line as the package to toggle it to 'keep' - which means to download this particular package):
    • perl: Larry Wall's Practical Extracting and Report Language
    • perl_manpages: Perl manpages

cygwin_SelectPackages.jpg

Next, while still in the Cygwin Select Packages window:

  1. click Devel, then select the following packages:
    • gcc-core - C compiler
    • make - GNU version of make utility
    • flex - fast lexical analyzer generator (for compiling Julius)
  2. click Utils, then select:
    • diffutils - A GNU collection of diff utilities
  3. click Libs, then select:
    • zlib - the zlib compression and decompression library

Click the 'Next' button and wait as the files download to your PC - this may take a while.

Step 3 - testing your Cygwin install

  1. Click Start>All Programs>Cygwin>Cygwin Bash Shell;
  2. At the command prompts, type perl -v; you should see version information for the Perl scripting language.

HTK

HTK's licence requires you to register before you can download the toolkit.   The software is open source but there are limitations on the distribution of the HTK Toolkit itself.  However, there is no limitation on the distribution of the Acoustic Models you create with the toolkit.

Step 1 - Register with HTK 

Step 2 - Download HTK Toolkit

Download the latest versions of the following packages: 

Download the HTK Book:

The HTK book is an excellent reference to the toolkit commands.  However, it is written for speech scientists and can be very confusing to beginners.

Step 3 - Install HTK

Use Windows Explorer to create a new directory in your "c:\cygwin" folder called "HTK" (see the Cygwin Cheat Sheet for information on Cygwin directory structures).  You could use the Cygwin Console, but it is easier just to use Windows Explorer to create your HTK directory. 

Move your downloaded files to your c:\cygwin\HTK directory :

  • htk-3.x-windows-binary.zip
  • HTK-samples-3.3.zip 
  • htkbook_html.tar.gz

Install Windows HTK Binaries 

Using Windows Explorer:
  • Right-click the htk-3.x-windows-binary.zip file, and select 'Extract All...' from your right-click menu; and
  • follow the steps in the extraction wizard to extract the zip file to your HTK directory.
  • this creates the c:\cygwin\HTK\htk-3.3-windows-binary\htk folder.
Note: do not execute HTK's "install" MS-DOS batch file.  This batch file creates a directory called "HTK.3.3" in your "Program Files" directory, and copies the HTK executables into it.


 

Install HTK Samples

Using Windows Explorer:
  • Right-click the HTK-samples-3.3.zip file and select 'Extract All..." from your right-click menu; and
  • Follow the steps in the extraction wizard to extract the zip file to your HTK directory.
  • This creates the c:\cygwin\HTK\HTK-samples-3.3\samples folder.

Install HTK Book

Using the Cygwin Console (Start>All Programs>Cygwin>Cygwin Bash Shell):

  • Use the 'tar' command to extract the HTK Book as follows:
$cd /HTK
$tar -xvzf htkbook_html.tar.gz
  • This creates the c:\cygwin\HTK\htkbook folder.

Step 4 - Copy HTK Perl Scripts

1. Get the name of your home directory:
  • Using the Cygwin Console (Start>All Programs>Cygwin>Cygwin Bash Shell)
    • type 'pwd' (i.e. print working directory) to find out what your home directory is (in this example my home directory is called 'Administrator'):
 $pwd

 /home/Administrator

2. Create voxforge directory

  • Using Windows Explorer:
    • go to your c:\cygwin\home\[home directory]
    • create a sub-folder called 'voxforge'
    • within voxforge, create another folder called 'HTK_Scripts'
3. Copy the following scripts
from:
  • c:\cygwin\HTK\htk-samples-3.3\samples\RMHTK\perl_scripts:
      • mkclscript.prl
  • c:\cygwin\HTK\htk-samples-3.3\samples\HTKTutorial:
      • maketrihed
      • prompts2mlf
      • prompts2wlist
to:
  •  c:\cygwin\home\[home directory]\voxforge\HTK_Scripts

Step 5 - Modify HTK mkclscript.prl Perl Script to work with Cygwin

With your favourite editor (Windows WordPad will do ...), edit the mkclscript.prl script (in c:\cygwin\home\[home directory]\voxforge\HTK_Scripts) by searching for each occurrence of the Perl 'chop;' command and replacing it with: 'chop;chop;'. 

Windows adds a return character (in addition to the newline character) at the end of each line of a text file and the second 'chop' command is required to remove it.

 

Step 6 - testing

See testing in the 'Update Your Path Environment Variable' section.

Julius

Julius has no limitations on distribution.  It uses Acoustic Models in HTK format, and Grammar files in its own format.

Julius is a large vocabulary continuous speech recognition (LVCSR) engine.  Julius is used in dictation applications.

Julian is a special version of Julius that performs grammar based speech recognition.   Julian is used for command and control applications.  

We will be using the Julian version of Julius for this tutorial. 

Step 1 - Download Windows version of Julius

Step 2 - Extract Julius

Using Windows Explorer:
  1. Change directory to c:\cygwin;
  2. Create a new directory called 'Julius';
  3. Copy your julius-3.5-win32bin.zip zip file to your new folder (i.e. 'c:\cygwin\Julius');
  4. Extract the Julius zip file:
    • right click the julius-3.5-win32bin.zip file
    • select 'Extract all...' from the right-click menu;
    • in 'Select a folder to extract files to' put in the following path:
C:\cygwin\Julius
  1.  
    • the extract process creates some files and these new directories
C:\cygwin\Julius\bin
C:\cygwin\Julius\doc
C:\cygwin\Julius\support
 

Step 3 - testing

See testing in the 'Update Your Path Environment Variable' section. 
 

Update Cygwin Path

Step 1 - Update your path environment variable to include HTK and Julius

1. from Windows Explorer, use a Cygwin editor (such as Vim) to edit:

c:/cygwin/etc/bash.bashrc

and add the following lines:  

PATH=/Julius/bin:/HTK/htk-3.3-windows-binary/htk:$PATH
export PATH

2. close any open Cygwin consoles for the change to take effect

Note: if you edit this file with a Window's-based editor, make sure you save the file so that it has Unix line endings, not Windows line endings. 

Unix line endings only have a single line feed (LF), whereas Windows line endings use a carriage return (CR) and a line feed (LF).  If you save a file with Windows line endings and try to use it in Cygwin, you get "bash: $'\r': command not found" errors.
 

Step 2 - Testing Your HTK/Julius Install

  • Open a Cygwin Console window:
    • Click Start>All Programs>Cygwin>Cygwin Bash Shell;
  • Type in "HVite" in the Cygwin Console;
if your system lists all the options available to the hvite command, then HTK is installed properly.
  • Type in "julian" in the Cygwin Console;
if your system displays version information for Julius, then Julius is installed properly;
  • If you don't see the expected results, review your installation steps for Julius or HTK to determine where you might have made an error.

Audacity

Step 1 - Download Audacity 

  1. Go to http://audacity.sourceforge.net/download/windows; and download the latest version of the Audacity audio editor;

Step 2 - Install Audacity

  1. Double-click "audacity-win-1.x.x" setup file;
  2. Follow the steps in the setup wizard;

Step 3 - Testing

  • Click Start>All Programs>Audacity.

 


Comments

Click the 'Add' link to add a comment to this page; click the 'Read More' link to view replies to a posted comment.

AddSearch

Compiling 64-bit HTK
By kmaclean - 1/4/2010 - 1 Replies

From the HTK mailing list (I have not tried this yet...):

Yes, on 64-bits the GCC compiler use -m64 to generate binary files for 64-bit architecture, also add -L options with the path for the libraries like X11.
That should solve your problems.

Regards,
Vitorio.

Le 2009-12-18 à 13:48, Elias Gerber a écrit :

> -m32 -a

Can not execute 'julian'
By daFunkyUnit - 11/10/2009 - 1 Replies

I am running on Mac OS X 10.5.8, and I cannot execute the julian command, saying that it "cannot execute binary file."


I un-tar'ed julius-3.5.2-multipath-linuxbin in where my HTK is installed, and I have added paths for HTK and julius into the $PATH environment variable.  I have checked the permissions for all the files in the julius-3.5.2-multipath-linuxbin/bin directory and they all are "-rwxr-xr-x" so they all should be executable. But I can not execute any of the commands, except for the perl scripts (gram2sapixml.pl, mkdfa.pl, yomi2voca.pl)

Please help!

Thanks,
-bao

question
By toothdoc - 7/19/2009 - 1 Replies
1. from Windows Explorer, use a Cygwin editor (such as Vim) to edit:
c:/cygwin/etc/bash.bashrc
and add the following lines:  
PATH=/Julius/bin:/HTK/htk-3.3-windows-binary/htk:$PATH
export PATH

There is no bash.bashrc file in etc folder. What am supposed to do now? Did I do something wrong?

compiling HTK using Microsoft Visual Studio
By kmaclean - 6/17/2009

From this post: Installing HTK on Microsoft Windows(음성인식 software)

Prerequisites

  • HTK has been verified to compile using Microsoft Visual Studio.
  • For testing, you will require a Perl interpreter such as ActivePerl.
  • You will need a tool such as 7-zip for unpacking the HTK source code archive.
  • Register on this site by accepting the HTK End User Licence Agreement, then download the latest HTK source code.
  • It is helpful if you have some familiarity with using the DOS command line interface, as you will need to interact with it in order to compile, install and run HTK.
  • Ensure that your PATH contains C:\Program Files\Microsoft Visual Studio\VC98\bin

Compilation

  1. Unpack the HTK sources using 7-zip.
  2. Open a DOS command window: Click Start, select Run type cmd at the prompt and click OK.
  3. cd into the directory in which you unpacked the sources.
  4. cd into the htk directory. Type:
    cd htk
  5. Create a directory for the library and tools. Type:
    mkdir bin.win32
  6. Run VCVARS32 (it should be in your path, see prerequisites above)
  7. Build the HTK Library, which provides the common functionality used by the HTK Tools. Enter the following commands:
    cd HTKLib
    nmake /f htk_htklib_nt.mkf all
    cd ..
  8. Build the HTK Tools
    cd HTKTools
    nmake /f htk_htktools_nt.mkf all
    cd ..
    cd HLMLib
    nmake /f htk_hlmlib_nt.mkf all
    cd ..
    cd HLMTools
    nmake /f htk_hlmtools_nt.mkf all
    cd ..

Installation

The HTK tools have now been built and are in the bin.win32 directory. You should add this directory to your PATH, so that you can run them easily from the command line in future.

Ibex
By sirjoy - 5/2/2009

I have Ubuntu 9.04. I couldnt make HTK works on /home/username/bin/htk so I used the ./configure without arguments and so it will be installed on /usr/local/bin instead. After this it works well

make install fails
By RobotJay - 2/24/2009 - 1 Replies

I finally got the "make all" command to (seemingly) work.  Now, when I run "make install" I get the following error:

jay@######:~/bin/htk$ make install
(cd HTKTools && make all) \
      || case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory `/home/jay/bin/htk/HTKTools'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jay/bin/htk/HTKTools'
(cd HTKTools && make install) \
    || case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory `/home/jay/bin/htk/HTKTools'
if [ ! -d /jay/bin/htk/bin ] ; then mkdir /jay/bin/htk/bin ; fi
mkdir: cannot create directory `/jay/bin/htk/bin': No such file or directory
make[1]: *** [mkinstalldir] Error 1
make[1]: Leaving directory `/home/jay/bin/htk/HTKTools'
make: *** [install-htktools] Error 1

I can't find any help for this anywhere, so I'd appreciate any you can offer.  TIA.

-Jay

P.S. I'm running Ubuntu Intrepid Ibex on a 32-bit system.

Additional Instructions to compile HTK on Ubuntu 8 (Hardy)
By psthomas@gmail.com - 12/2/2008
Okiedokie people, Here are some solutions to a number of problems that I saw people having (myself included):
Alternate Ubuntu Directions for Step 5 above (from a mostly clean Hardy install):
1) You'll need gcc 3.4 (as mentioned)
2) Use synaptic or apt to get:
- cpp-3.4
- gcc-3.4
- gcc-3.4-base
3) Try to run configure.
4) If you see an error like "configure:1799: error: C compiler cannot create executables" then it's probably because you're missing some link libraries. Use synaptic/apt to get:
- libc6-dev
4) Try to "make all"
5) If you see an error like "HGraf.c:73:77: X11/Xlib.h: No such file or director", then you need:
- libx11-dev
6) Now "make all" should succeed.

Hope that helps!
~PST

Some references:
- http://groups.google.com/group/emm-ruby/browse_thread/thread/d1b5dafeb6296d3d?pli=1
- http://anaaman.blogspot.com/2006/01/crt1o-no-such-file-no-such-file-or.html
- http://ubuntuforums.org/archive/index.php/t-49497.html




 

 

error
By hamid - 9/4/2008 - 6 Replies

Hi,

when I want update my path environment variable it gives me error and testing HTK/julius dosen't gives me the expected results.
when I open Cygwin it gives me this:

  bash: $'\r': comand not found
  bash: $'\r': comand not found
  ': not a valid identifier
  bash: $'\r': comand not found


what should I do?

best regards,
Hamid.

Makefile Errors?
By Ramen - 8/8/2008 - 1 Replies

I am trying to follow the instructions listed above for installing HTK.   I am using a 32-bit system.  I get as far as running

$./configure --prefix=/home/yourusername/bin/htk-3.4

But when I try to run make all, I get about 800 errors. At the top of the list of errors, my terminal says,

"HGraf.c:73:77: error: X11/Xlib.h: No such file or directory
HGraf.c:74:23: error: X11/Xutil.h: No such file or directory
HGraf.c:75:21: error: X11/Xos.h: No such file or directory
HGraf.c:77:27: error: X11/keysymdef.h: No such file or directory"

and then it has several lines of stuff looking like,

"HGraf.c:87: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token"

 Does anyone know what's going on here/how I can fix this?

 

By the way, I coculd not find a module to make my version of GCC compatible with 3.4.  Instead, I simply downloaded GCC 3.4 and edited the Makefile so that it would run GCC 3.4 instead of my new version of GCC.

 

Thanks!

HTK comple error.
By Sergey S. - 4/12/2008 - 5 Replies

Hello, 

I am trying to compile HTK-3.4 on Ubuntu 7.10 but I get this error:

 make all

...

/usr/bin/ld: skipping incompatible /usr/bin/../lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libX11.a when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status
make[1]: *** [HSLab] Error 1
make[1]: Leaving directory `/home/serg/bin/htk/HTKTools'
make: *** [htktools] Error 1

Any idea what might be wrong?

Thanks in advance,

--Sergey 

Julius 4.0.1
By kmaclean - 3/12/2008

Some compile problems with Julius 4.0 on Cygwin have been fixed in Julius 4.0.1

 

 

Compiling HTK 3.4 on Windows XP
By kmaclean - 9/30/2007 - 3 Replies
  • See Ivan A. Uemlianin's blog site article:  Compiling HTK 3.4 on Windows XP -  covers compilation with Visual C++ 2005 Express Edition;
  • Arlindo Vega has a webpage on compiling HTK with Visual Studio 6 (VC6), Visual Studio .NET 2003 (VC7) and Visual Studio 2005 (VC8)



 

 

error in compiling julian
By amza - 1/7/2008 - 2 Replies

I compile julian from source (julius-3.5.2.tar.gz, and then extracts it), because I need julian, not julius, by typing the command as follows:

$./configure --prefix=/home/riset/bin/julius-3.5.2  --enable-julian

The compile didn't work well because there are errors as follows:

$ ./configure --prefix=/home/riset/bin/julius-3.5.2 --enable-julian >a.txt
./configure: line 1033: cmp: command not found
./configure: line 714: cmp: command not found
configure: warning: no iconv, gram2sapixml.pl may not work
./configure: line 1331: cmp: command not found
./configure: line 1203: cmp: command not found
./configure: line 2009: cmp: command not found
configure: warning: not found
configure: warning: libsndfile enables AIFF AU SND NIST format for Julius.
It's available at http://www.mega-nerd.com/libsndfile/
./configure: line 3094: cmp: command not found

I don't understand the command "cmp" in "configure" file, because the file is already available. Can you help me? I haven't been able to run julian yet since 3 weeks ago.  Thank you.

 

~amza 

 

 

error in compiling HTK and Julius
By hazel - 1/6/2008 - 1 Replies

1. I have already configured HTK by using command "./configure .......", but when I type in "make all" on cygwin bash shell, there is errors as follows:

$ make all
make[1]: Entering directory `/home/riset/bin/htk-3.3/HTKLib'
gcc -Wall -Wno-switch -g -O2 -I.    -c -o HShell.o HShell.c
HShell.c: In function `KeyPressed':
HShell.c:1487: error: `FIONREAD' undeclared (first use in this function)
HShell.c:1487: error: (Each undeclared identifier is reported only once
HShell.c:1487: error: for each function it appears in.)
make[1]: *** [HShell.o] Error 1
make[1]: Leaving directory `/home/riset/bin/htk-3.3/HTKLib'
make: *** [all] Error 1

2. I also have extracted julius-3.5.3 to "/home/riset/bin". When I compiled julian by typing:

$./configure --prefix=/home/riset/bin/julius-3.5.3  --enable-julian

    there is an error as follows:

bash: $./configure: No such file or directory

Can you help me to solve these two problems, please? Thank you.

 

~hazel 

 

compile and install htk
By amza - 12/31/2007 - 8 Replies

When I configured HTK by exceuting command:

$./configure --prefix=/home/yourusername/bin/htk-3.3

There is an error like this:

bash: ./configure: No such file or directory

How to solve this problem? Thank you... 

HTK INSTALLATION
By kat_wills - 12/28/2007 - 1 Replies

Hi,

It is about installation of htk.I already have htk installed on my linux system,but the location of installation is different from the steps specified on this tutorial.I have tried installing multiple copies but it did not work.

Since htk has already been installed and working,can I skip the section on htk and focus on other parts of the tutorials or must it be installedfollowing your steps.

 

cheers. 

 

error in testing julius
By amza - 11/22/2007 - 11 Replies I have followed all directions, but the julius testing doesn't work. When I typed "julian" on Cygwin Bash Shell, it doesn't display the version of Julius, it's just blank. I don't know what is missing when installing julius, I have done all steps. Can you help me? Thank you.

ERROR TESTING JULIUS
By rovira74 - 10/20/2007 - 3 Replies

Hi,

I was unable to test julius installation at the prompt as directed but when I typed julian,it gave the version.

Was there any error or are 'julius' and 'julian' commands the same