Click here to register.

Linux: Download HTK, Julius & Audacity

Click here for the Windows version of this tutorial 

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 models you create with the toolkit.

Step 1 - Register with HTK 

Step 2 - Download HTK Toolkit and Samples

Create a new directory in your home directory called 'bin', it should have the following path (replace 'yourusername' with the user name you are using on your system):

  • /home/yourusename/bin 

click the following links:

and save them to your new bin directory.

Step 3 - Download HTK Book

Click the following link: 

and save it to your new bin directory.

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 4 - Unpack you source files

Extract the files using:

  • Nautilus (right click each tar/gzipped file and click extract here); or
  • use tar from the command line for the following files:
    • tar -xvzf HTK-3.4-alpha.tar.gz
    • tar -xvzf HTK-samples-3.4-alpha.tar.gz
    • tar -xvzf htkbook_html.tar.gz

this should create the following directories in your bin folder:

  • htk-3.4
  • samples
  • htkbook
move the 'samples' and 'htkbook' directories to your htk-3.4 folder.

Step 5 - Compile & Install HTK

Compiler version

If you have a newer version of the gcc compiler (version 4 or above), you will need to install gcc version 3.4 compatibility modules so that HTK will compile properly. Use gcc's version command to see which version is installed on your system:

$gcc -v

Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-cpu=generic --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC)


If you have version 4.0 or above (I have version 4.3.0) use yum to install the required files to your system:

$su

#yum install compat-gcc-34-c++ compat-gcc-34

32-bit Systems

After unpacking the sources, open a command line terminal and go to the /hom/yourusername/bin/htk3.4 directory where you downloaded your files. 

configure 

The default location for binaries is "/usr/local" which will put the tools in "/usr/local/bin".  You need to change this default location using the "./configure" script to specify where you want the binaries installed:

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

This directs the make command to put all your binaries in the following folder:

  • /home/yourusername/bin/htk-3.4/bin.linux

64-bit Systems

After unpacking the sources, open a command line terminal and go to the /hom/yourusername/bin/htk3.4 directory where you downloaded your files. 

You now need to install 386 compatibility versions of some development libraries:

$su

#yum install glibc-devel.i386 libX11-devel.i386

configure 

The default location for binaries is "/usr/local" which will put the tools in "/usr/local/bin".  You need to change this default location using the "./configure" script to specify where you want the binaries installed:

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

This directs the make command to put all your binaries in the following folder:

  •  /home/yourusername/bin/htk-3.4/bin.linux

make 

To build the libraries and binaries, execute the following:

$make all

Running the following command will install them: 

$make install

Step 6 - Copy required HTK Perl Scripts

Create a new directory called "HTK_scripts" in your voxforge folder, it should have the following path:

  • /home/yourusename/voxforge/HTK_scripts 

Copy the following HTK scripts to your newly created 'HTK_scripts' folder:

  • mkclscript.prl (located in /htk-3.4/samples/RMHTK/perl_scripts folder)
  • maketrihed (located in /htk-3.4/samples/HTKTutorial folder)
  • prompts2mlf (located in /htk-3.4/samples/HTKTutorial folder)
  • prompts2wlist (located in /htk-3.4/samples/HTKTutorial folder)

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 Julius

click the following link: 

and save it to your '/home/yourusename/bin' directory.

(note: if you want to compile Julius from source, see this FAQ entry) 

Step 2 - Extract Julius 

Extract the file using:

  • Nautilus (right click the tar/gzipped file and click extract here)
  • use tar from the command line:
    • tar -xvzf julius-3.5.2.tar.gz
this should create a julius-3.5.2 directory in your bin folder.

Update User Path

To update your user path, you need to add the following directories your user path variable:

  • /home/yourusename/bin/htk-3.4/bin.linux;
  • /home/yourusename/bin/htk-3.4/lib.linux; and
  • /home/yourusename/bin/julius-3.5.2-multipath-linuxbin/bin.

To do this, edit your '.bash_profile' file in your home directory (in Fedora you need to show 'hidden files' in Nautilus - so you can display file names with a period in front of them). You do this by adding the listed paths, separated by a colon (":") to the end of the PATH variable as follows (all one line, no spaces):
 

# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/home/yourusename/bin/htk-3.4/bin.linux:
home/yourusename/bin/htk-3.4/lib.linux:
/home/yourusename/bin/julius-3.5.2-multipath-linuxbin/bin

Log out and log back in to make your path change effective.

Testing Your HTK/Julius Install

  • Type in "HVite -V" in a Command Console Window;
if your system lists all the options available to the hvite command, then HTK is installed properly.
  • Type in "julian" in a Command Console Window;
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

If you are using Linux (we will be using the Fedora for these tutorials) use the following command to download and install Audacity (as superuser):

$su
Password:
#yum install audacity 

Click here to download Audacity from its web site.


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

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 - 1 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!

Automated Audio Segmentation accuracy
By Sergey - 4/18/2008 - 1 Replies Hi Ken,
I posted the following message yesterday, but some how I did it in a wrong plase (http://www.voxforge.org/home/dev),
and I couldn't find out how to move it here. So I'm just posting it again (but, hopefully, to the right plase now ;)
-----------------------------------------------------------
On 32bit version of Ubuntu HTK compiled without a problem.
Then I followed the tutorial "Automated Audio Segmentation Using Forced Alignment" without a hitch up to step 6.
In Audacity I see a considerable misalignement between audio and labels.
For example in the phrase "Chapter Four, Part One" the audio corresponding to label "part" contains sounds "part one",
and the audio corresponding to label "one" contains only silence.
Is it a normal misalignement or am I doing something wrong?
-----------------------------------------------------------
Thanks a lot,
--Sergey

Segmentation Script
By Sergey - 4/18/2008 - 2 Replies

Hello,
I am trying to perform "Step 7 - Run the Segmentation Script" of the "Automated Audio Segmentation Using Forced Alignment"
but when I try to download the script http://www.voxforge.org/home/dev/autoaudioseg/htksegment_pl2.txt I get a page saying:
"Permission Denied! You do not have sufficient privileges to access this page." Please help.
Thanks a lot,
--Sergey

P.S. I did login first, of course. 

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
  • 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)



 

 

untitled
By sws - 2/1/2008 i had same problem and it works when i put cygwin1.dll , cygiconv-2.dll and cygz.dll in my windows system file