Changeset 4768
- Timestamp:
- May 16, 2017, 9:35:20 AM (4 years ago)
- Location:
- lliurex-tts/trunk/fuentes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-tts/trunk/fuentes/debian/changelog
r4755 r4768 2 2 3 3 * Added festival capabilities too for catalan language 4 * Modified script to store wav file instead of play it 4 5 5 6 -- Jose A. Murcia <joamuran@gmail.com> Mon, 15 May 2017 13:56:56 +0200 -
lliurex-tts/trunk/fuentes/simple-google-tts/simple_google_tts
r4755 r4768 49 49 50 50 Usage="\ 51 $(basename "$0") [-p|-g|-h ] languagecode ['strings'|'file.txt']51 $(basename "$0") [-p|-g|-h|-w wav_file] languagecode ['strings'|'file.txt'] 52 52 53 53 -p: use offline TTS (pico2wave) instead of Google's TTS system 54 54 -g: activate gui notifications (via notify-send) 55 55 -h: display this help section 56 -w: wav_file: if you want to only save wav_file, instead of speak it. 56 57 57 58 Selection of valid language codes: en, es, de... … … 99 100 } 100 101 102 101 103 check_environment () { 102 104 if [[ ! -f "$speakpl" && "$OptOffline" != "1" ]]; then … … 110 112 fi 111 113 } 114 112 115 113 116 check_existing_instance(){ … … 121 124 } 122 125 126 123 127 arg_evaluate_options(){ 124 128 # grab options if present 125 while getopts "gph " Options; do129 while getopts "gphw:" Options; do 126 130 case $Options in 127 131 g ) OptNotify="1" … … 132 136 exit 0 133 137 ;; 138 w ) WavToSave=${OPTARG} 139 ;; 134 140 \? ) echo "$Usage" 135 141 exit 1 … … 138 144 done 139 145 } 146 140 147 141 148 arg_check_input(){ … … 164 171 } 165 172 173 166 174 notify(){ 167 175 echo "$1" … … 170 178 fi 171 179 } 180 172 181 173 182 check_connectivity(){ … … 178 187 fi 179 188 } 189 190 180 191 181 192 set_tts_mode(){ … … 191 202 } 192 203 204 193 205 set_input_mode(){ 194 206 if [[ "$InputMode" = "xsel" ]]; then … … 206 218 fi 207 219 } 220 208 221 209 222 split_into_paragraphs(){ … … 240 253 } 241 254 255 242 256 pico_synth(){ 243 257 pico2wave --wave="$OutFile" --lang="$LangCode" "$1" 244 258 } 245 259 260 246 261 speakpl_synth(){ 247 262 "$speakpl" "$LangCode" <(echo "$1") "$OutFile" > /dev/null 2>&1 248 263 } 264 249 265 250 266 tts_google(){ … … 265 281 [[ -f "out_$((i-1)).mp3" ]] && rm "out_$((i-1)).mp3" 266 282 echo "$MsgInfoPlayback $((i+1))" 267 $Player "$OutFile" > /dev/null 2>&1 & 268 PlayerPID="$!" 283 284 echo $WavToSave 285 if [[ $WavToSave != "" ]]; then # Check if we want to save - LLX 286 echo "Saving $OutFile to $WavToSave" 287 cp $OutFile $WavToSave 288 else 289 $Player "$OutFile" > /dev/null 2>&1 & 290 PlayerPID="$!" 291 fi # End of checking if we want only to save - LLX 269 292 else 270 293 echo "$MsgInfoSectionEmpty" … … 273 296 done 274 297 } 298 299 275 300 276 301 tts_pico(){ … … 303 328 fi 304 329 305 echo "$MsgInfoPlayback" 306 $Player "$OutFile" > /dev/null 2>&1 307 } 330 if [[ $WavToSave != "" ]]; then # Check if we want to save - LLX 331 echo "Saving $OutFile to $WavToSave" 332 cp $OutFile $WavToSave 333 else 334 echo "$MsgInfoPlayback" 335 $Player "$OutFile" > /dev/null 2>&1 336 fi # End LLX 337 } 338 308 339 309 340 cleanup(){
Note: See TracChangeset
for help on using the changeset viewer.