#!/bin/bash
#
# Script to install Festival and various tools...
#
# Author: Nicholas Volk (nvolk@ling.helsinki.fi)


if [ $# = 0 ]; then
    $0 speech_tools
    $0 festival
    $0 festvox
    $0 suopuhe
fi

if [ "$1" = "speech_tools" ]; then
    cd # Go to your home directory

    wget http://www.festvox.org/packed/festival/latest/speech_tools-1.2.96-beta.tar.gz
    
    tar zxvf speech_tools-1.2.96-beta.tar.gz
    
    perl -pi~ -e "s/\{.*'d'.*fd_kill_word/\/\/ $&/;" speech_tools/siod/editline.c
    
    cd speech_tools

    ./configure
    nice make
    cd ..
fi


if [ "$1" = "festival" ]; then
    cd # Go to your home directory


    wget http://www.festvox.org/packed/festival/latest/festival-1.96-beta.tar.gz
    wget http://www.festvox.org/packed/festival/latest/festvox_kallpc16k.tar.gz

    wget http://www.festvox.org/packed/festival/latest/festlex_CMU.tar.gz

    wget http://www.festvox.org/packed/festival/latest/festlex_POSLEX.tar.gz

    tar -zxvf festival-1.96-beta.tar.gz
    tar -zxvf festvox_kallpc16k.tar.gz
    tar -zxvf festlex_CMU.tar.gz
    tar -zxvf festlex_POSLEX.tar.gz
    cd festival
    ./configure
    nice make
    cd ..
fi

if [ "$1" = "festvox" ]; then
    cd ..
    wget http://www.festvox.org/festvox-2.1/festvox-2.1-release.tar.gz
    tar -zxvf festvox_kallpc16k.tar.gz
    cd festvox
    ./configure
    nice make
    cd ..
fi

if [ "$1" = "suopuhe" ]; then
    cd
    wget http://www.ling.helsinki.fi/suopuhe/download/hy_fi_mv_diphone-20041119.tgz
    tar -zxvf hy_fi_mv_diphone-20041119.tgz
fi

