Changeset 4768


Ignore:
Timestamp:
May 16, 2017, 9:35:20 AM (2 years ago)
Author:
joamuran
Message:

fixed

Location:
lliurex-tts/trunk/fuentes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lliurex-tts/trunk/fuentes/debian/changelog

    r4755 r4768  
    22
    33  * Added festival capabilities too for catalan language
     4  * Modified script to store wav file instead of play it
    45
    56 -- 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  
    4949
    5050Usage="\
    51 $(basename "$0") [-p|-g|-h] languagecode ['strings'|'file.txt']
     51$(basename "$0") [-p|-g|-h|-w wav_file] languagecode ['strings'|'file.txt']
    5252
    5353    -p:   use offline TTS (pico2wave) instead of Google's TTS system
    5454    -g:   activate gui notifications (via notify-send)
    5555    -h:   display this help section
     56    -w: wav_file: if you want to only save wav_file, instead of speak it.
    5657
    5758    Selection of valid language codes: en, es, de...
     
    99100}
    100101
     102
    101103check_environment () {
    102104    if [[ ! -f "$speakpl" && "$OptOffline" != "1" ]]; then
     
    110112    fi
    111113}
     114
    112115
    113116check_existing_instance(){
     
    121124}
    122125
     126
    123127arg_evaluate_options(){
    124128    # grab options if present
    125     while getopts "gph" Options; do
     129    while getopts "gphw:" Options; do
    126130      case $Options in
    127131        g ) OptNotify="1"
     
    132136            exit 0
    133137            ;;
     138        w ) WavToSave=${OPTARG}
     139            ;;
    134140       \? ) echo "$Usage"
    135141            exit 1
     
    138144    done
    139145}
     146
    140147
    141148arg_check_input(){
     
    164171}
    165172
     173
    166174notify(){
    167175  echo "$1"
     
    170178  fi
    171179}
     180
    172181
    173182check_connectivity(){
     
    178187  fi
    179188}
     189
     190
    180191
    181192set_tts_mode(){
     
    191202}
    192203
     204
    193205set_input_mode(){
    194206  if [[ "$InputMode" = "xsel" ]]; then
     
    206218  fi
    207219}
     220
    208221
    209222split_into_paragraphs(){
     
    240253}
    241254
     255
    242256pico_synth(){
    243257  pico2wave --wave="$OutFile" --lang="$LangCode" "$1"
    244258}
    245259
     260
    246261speakpl_synth(){
    247262  "$speakpl" "$LangCode" <(echo "$1") "$OutFile" > /dev/null 2>&1
    248263}
     264
    249265
    250266tts_google(){
     
    265281      [[ -f "out_$((i-1)).mp3" ]] && rm "out_$((i-1)).mp3"
    266282      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
    269292    else
    270293      echo "$MsgInfoSectionEmpty"
     
    273296  done
    274297}
     298
     299
    275300
    276301tts_pico(){
     
    303328  fi
    304329 
    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
    308339
    309340cleanup(){
Note: See TracChangeset for help on using the changeset viewer.