comparison demo/build_festival.sh @ 0:4dad87badb0c

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