Note, that this recipe is not updated long time and could be outdated!
Got it.

HMM-based Speech Synthesis System (HTS)

See also:  HTS Engine

The Hidden Markov Model Toolkit (HTK) is a portable toolkit for building and manipulating hidden Markov models. HTK tools are open sourced with specific license. HTS tools adds patches and customizes HTK for speech synthesis.

This page describes, how to set up necessary tools on 64-bit Ubuntu 16.04 server or workstation. General setup of standard Ubuntu server is described here (in Latvian).


Intro for terminal and command execution

If you are not sure how to execute described commands, look at Command line terminal.

Server setup

  1. If tools are set up on server, some environment settings could be neccessary to set, (e.g. default locale with  UTF-8 encoding and timezone). To set up these, enter commands, e.g.:

    sudo locale-gen "en_US.UTF-8"
    sudo dpkg-reconfigure locales
    sudo dpkg-reconfigure tzdata

    where en_US.UTF-8 is necessary UTF-8 enabled locale, and proceed with setup wizards.

  2. Install additionally needed packages:

    sudo apt-get install csh gcc g++ g++-multilib make libncurses5-dev libx11-dev clang byacc flex bc

Download packages

In general tools can be downloaded, extracted in any place, but there are few configuration setting, where fixed path is necessary. This guide assumes all tools are set in /home/HTS folder.

  1. Create /home/HTS folder and add access permissions to all registered users to it:

    sudo mkdir /home/HTS
    sudo chmod 777 /home/HTS
    cd /home/HTS
  2. Download necessary packages using wget, by executing following commands:


    wget --user=$WUSER --password=$WPASS
    wget --user=$WUSER --password=$WPASS



    where $WUSER and $WPASS are actual username and password received from HTK Registration form

Don't try to download the latest versions of the tools!
Use precise versions of packages from this guide, because one tool can't be set up and executed with arbitrary version of another tool!

Compile and set up tools

  1. Compile speech_tools:

    tar xvf speech_tools-2.4-release.tar.gz
    cd speech_tools/
    cd ..
  2. Compile festival:

    tar xvf festival-2.4-release.tar.gz
    cd festival/
    cd ..
  3. Compile festvox:

    tar xvf festvox-2.7.0-release.tar.gz
    cd festvox/
    cd ..
  4. Extract, patch and compile HTK tools:

    tar xvf HTK-3.4.1.tar.gz
    tar xvf HDecode-3.4.1.tar.gz
    mkdir hts_patch
    mv HTS-2.3_for_HTK-3.4.1.tar.bz2 hts_patch/
    cd hts_patch/
    tar xvf HTS-2.3_for_HTK-3.4.1.tar.bz2
    cd ../htk/
    patch -p1 -d . < ../hts_patch/HTS-2.3_for_HTK-3.4.1.patch
    sudo make install
    1. If something like following error occurs:

      esignal.c: In function 'WriteHeader': esignal.c:1184:25: error: 'ARCH'
      undeclared (first use in this function) architecture = ARCH;
    2. Add additional parameter to configure and complete compilation and installation:

      ./configure CFLAGS="-DARCH=linux"
      and compile and install HTK again.

  5. Make and install hlmtools and hdecode:

    make hlmtools; sudo make install-hlmtools
    make hdecode; sudo make install-hdecode
    cd ..
    1. If compilation error occurs:

      Makefile:77: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.
    2. Open file HLMTools/Makefile and replace leading 8 spaces with tab in following line:

      if [ ! -d $(bindir) -a X_@TRADHTK@ = X_yes ] ; then mkdir -p $(bindir) ; fi
      and compile and install hlmtools again.
  6. Extract, compile and install HTS engine:

    tar xvf hts_engine_API-1.10.tar.gz
    cd hts_engine_API-1.10/
    sudo make install
    cd ..
  7. Extract, compile and install SPTK tools:

    tar xvf SPTK-3.11.tar.gz
    cd SPTK-3.11/
    sudo make install
    cd ..
  8. Extract and install ActiveTcl (this package is probably unnecessary for latest versions of HTK):

    tar xvf ActiveTcl8.4.5.0-linux-ix86-83070.tar.gz
    cd ActiveTcl8.4.5.0-linux-ix86/
    sudo ./

    and follow setup wizard instructions.

  9. Go back to HTS folder:

    cd ..

Set up HTS demo project

  1. Extract and configure HTS demo project:

    tar xvf HTS-demo_CMU-ARCTIC-SLT.tar.bz2
    cd HTS-demo_CMU-ARCTIC-SLT/
  2. Configure project:

    ./configure   \
    --with-tcl-search-path=/usr/local/ActiveTcl/bin \
    --with-fest-search-path=/home/HTS/festival/examples \
    --with-sptk-search-path=/usr/local/SPTK/bin \
    --with-hts-search-path=/usr/local/HTS-2.3/bin \

    where /home/HTS is folder of all installed tools.

  3. Make demo project:

  4. Run script in background with output redirected to log file:

    /usr/bin/perl scripts/ scripts/ > log 2>&1 &

    or, if you run it on workstation, make it low priority task with command:

    nice -n20 /usr/bin/perl scripts/ scripts/ > log 2>&1 &
  5. Look at the progress on log file with the command:

    tail -f log

Tags English Ubuntu Valoda Serveris
Created by Valdis Vītoliņš on 2018-01-02 16:44
Last modified by Valdis Vītoliņš on 2021-04-13 14:29
Xwiki Powered
Creative Commons Attribution 3.0 Unported License