e@0: function build_tools { e@0: e@0: rm exports.txt # Create a new exports file for this run e@0: touch exports.txt e@0: e@0: e@0: e@0: e@0: echo "Installing festival speech synthesizer" e@0: e@0: # Check whether speech_tools github directory exists e@0: e@0: if [ ! -d tools/speech_tools ]; then e@0: e@0: echo "Cloning speech_tools git repository" e@0: e@0: git clone https://github.com/festvox/speech_tools tools/speech_tools e@0: e@0: fi e@0: e@0: ## TODO: Check whether all speech_tool files exist. e@0: e@0: if [ ! -f "tools/speech_tools/bin/align" ]; then e@0: e@0: echo "Building speech_tools" e@0: e@0: cd tools/speech_tools; ./configure; make; cd -; e@0: e@0: fi e@0: e@0: # Check whether festival github directory exists e@0: e@0: if [ ! -d tools/festival ]; then e@0: e@0: echo "2. Cloning festival git repository" e@0: e@0: git clone https://github.com/festvox/festival tools/festival e@0: e@0: #lexes="festlex_CMU festlex_OALD festlex_POSLEX" e@0: lexes="festlex_POSLEX" e@0: for lex in $lexes; e@0: do e@0: wget http://festvox.org/packed/festival/2.5/$lex.tar.gz; tar xzvf $lex.tar.gz -C tools/ e@0: done e@0: e@0: fi e@0: e@0: if [ ! -f "tools/festival/bin/festival" ]; then e@0: e@0: echo "2. Building festival speech synthesizer" e@0: e@0: cd tools/festival; ./configure; make; cd -; e@0: e@0: fi e@0: e@0: if [ -f "tools/festival/bin/festival" ]; then e@0: e@0: echo "2. Adding festival to path. " e@0: echo "" e@0: echo "To permamently add festival to your path, add:" e@0: echo "" e@0: echo 'export PATH=$(pwd)/tools/festival/bin:$PATH' e@0: echo "" e@0: echo "to your .bashrc or .bash_profile." e@0: e@0: export PATH=$(pwd)/tools/festival/bin:$PATH e@0: echo 'export PATH=$(pwd)/tools/festival/bin:$PATH' >> exports.txt e@0: fi e@0: e@0: e@0: echo "2. Downloading and installing festival voices" e@0: e@0: VOICES="festvox_cmu_indic_ben_rm_cg festvox_cmu_indic_guj_ad_cg festvox_cmu_indic_guj_dp_cg festvox_cmu_indic_guj_kt_cg festvox_cmu_indic_hin_ab_cg festvox_cmu_indic_kan_plv_cg festvox_cmu_indic_mar_aup_cg festvox_cmu_indic_mar_slp_cg festvox_cmu_indic_pan_amp_cg festvox_cmu_indic_tam_sdr_cg festvox_cmu_indic_tel_kpn_cg festvox_cmu_indic_tel_sk_cg festvox_cmu_indic_tel_ss_cg festvox_cmu_us_aew_cg festvox_cmu_us_ahw_cg festvox_cmu_us_aup_cg festvox_cmu_us_awb_cg festvox_cmu_us_axb_cg festvox_cmu_us_bdl_cg festvox_cmu_us_clb_cg festvox_cmu_us_eey_cg festvox_cmu_us_fem_cg festvox_cmu_us_gka_cg festvox_cmu_us_jmk_cg festvox_cmu_us_ksp_cg festvox_cmu_us_ljm_cg festvox_cmu_us_lnh_cg festvox_cmu_us_rms_cg festvox_cmu_us_rxr_cg festvox_cmu_us_slp_cg festvox_cmu_us_slt_cg festvox_kallpc16k festvox_rablpc16k" e@0: e@0: for VOICE in $VOICES; do e@0: if [ ! -f "tools/$VOICE.tar.gz" ]; then e@0: e@0: wget "http://festvox.org/packed/festival/2.5/voices/$VOICE.tar.gz" -O tools/$VOICE.tar.gz e@0: e@0: fi e@0: e@0: echo "Uncompressing $VOICE.tar.gz"... e@0: cd tools; tar xzf $VOICE.tar.gz; cd - e@0: e@0: done e@0: } e@0: e@0: while true; do e@0: read -p "Do you wish to continue installing festival locally? " yn e@0: case $yn in e@0: [Yy]* ) build_tools; break;; e@0: [Nn]* ) exit;; e@0: * ) echo "Please answer Yes or No.";; e@0: esac e@0: done e@0: e@0: e@0: echo "This installation process produced the following exports.txt:" e@0: cat exports.txt e@0: e@0: while true; do e@0: read -p "Do you want to add these exports to your ~/.bashrc? " yn e@0: case $yn in e@0: [Yy]* ) cat exports.txt >> $HOME/.bashrc; echo "Execute: source ~/.bashrc for this session"; break;; e@0: [Nn]* ) exit;; e@0: *) echo "Please asnwer Yes or No.";; e@0: esac e@0: done