annotate demo/build_festival.sh @ 13:16066f0a7127 tip

fixed the problem with brat
author Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk>
date Sat, 08 Dec 2018 11:02:40 +0000
parents 90155bdd5dd6
children
rev   line source
e@0 1 function build_tools {
e@0 2
e@0 3 rm exports.txt # Create a new exports file for this run
e@0 4 touch exports.txt
e@0 5
e@0 6
e@0 7
e@0 8
e@0 9 echo "Installing festival speech synthesizer"
e@0 10
e@0 11 # Check whether speech_tools github directory exists
e@0 12
e@0 13 if [ ! -d tools/speech_tools ]; then
e@0 14
e@0 15 echo "Cloning speech_tools git repository"
e@0 16
e@0 17 git clone https://github.com/festvox/speech_tools tools/speech_tools
e@0 18
e@0 19 fi
e@0 20
e@0 21 ## TODO: Check whether all speech_tool files exist.
e@0 22
e@0 23 if [ ! -f "tools/speech_tools/bin/align" ]; then
e@0 24
e@0 25 echo "Building speech_tools"
e@0 26
e@0 27 cd tools/speech_tools; ./configure; make; cd -;
e@0 28
e@0 29 fi
e@0 30
e@0 31 # Check whether festival github directory exists
e@0 32
e@0 33 if [ ! -d tools/festival ]; then
e@0 34
e@0 35 echo "2. Cloning festival git repository"
e@0 36
e@0 37 git clone https://github.com/festvox/festival tools/festival
e@0 38
e@0 39 #lexes="festlex_CMU festlex_OALD festlex_POSLEX"
e@0 40 lexes="festlex_POSLEX"
e@0 41 for lex in $lexes;
e@0 42 do
e@0 43 wget http://festvox.org/packed/festival/2.5/$lex.tar.gz; tar xzvf $lex.tar.gz -C tools/
e@0 44 done
e@0 45
e@0 46 fi
e@0 47
e@0 48 if [ ! -f "tools/festival/bin/festival" ]; then
e@0 49
e@0 50 echo "2. Building festival speech synthesizer"
e@0 51
e@0 52 cd tools/festival; ./configure; make; cd -;
e@0 53
e@0 54 fi
e@0 55
e@0 56 if [ -f "tools/festival/bin/festival" ]; then
e@0 57
e@0 58 echo "2. Adding festival to path. "
e@0 59 echo ""
e@0 60 echo "To permamently add festival to your path, add:"
e@0 61 echo ""
e@0 62 echo 'export PATH=$(pwd)/tools/festival/bin:$PATH'
e@0 63 echo ""
e@0 64 echo "to your .bashrc or .bash_profile."
e@0 65
e@0 66 export PATH=$(pwd)/tools/festival/bin:$PATH
e@0 67 echo 'export PATH=$(pwd)/tools/festival/bin:$PATH' >> exports.txt
e@0 68 fi
e@0 69
e@0 70
e@0 71 echo "2. Downloading and installing festival voices"
e@0 72
e@0 73 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 74
e@0 75 for VOICE in $VOICES; do
e@0 76 if [ ! -f "tools/$VOICE.tar.gz" ]; then
e@0 77
e@0 78 wget "http://festvox.org/packed/festival/2.5/voices/$VOICE.tar.gz" -O tools/$VOICE.tar.gz
e@0 79
e@0 80 fi
e@0 81
e@0 82 echo "Uncompressing $VOICE.tar.gz"...
e@0 83 cd tools; tar xzf $VOICE.tar.gz; cd -
e@0 84
e@0 85 done
e@0 86 }
e@0 87
e@0 88 while true; do
e@0 89 read -p "Do you wish to continue installing festival locally? " yn
e@0 90 case $yn in
e@0 91 [Yy]* ) build_tools; break;;
e@0 92 [Nn]* ) exit;;
e@0 93 * ) echo "Please answer Yes or No.";;
e@0 94 esac
e@0 95 done
e@0 96
e@0 97
e@0 98 echo "This installation process produced the following exports.txt:"
e@0 99 cat exports.txt
e@0 100
e@0 101 while true; do
e@0 102 read -p "Do you want to add these exports to your ~/.bashrc? " yn
e@0 103 case $yn in
e@0 104 [Yy]* ) cat exports.txt >> $HOME/.bashrc; echo "Execute: source ~/.bashrc for this session"; break;;
e@0 105 [Nn]* ) exit;;
e@0 106 *) echo "Please asnwer Yes or No.";;
e@0 107 esac
e@0 108 done