FYI GoogleTTS Returns from the Dead.. Again

Discussion in 'Today's Tech News & Events' started by wardmundy, Jul 29, 2015.

  1. Jose Casares

    Jose Casares Member

    Joined:
    Mar 21, 2016
    Messages:
    35
    Likes Received:
    2
    How did you get it to work?
     
  2. jerrm

    jerrm Guru

    Joined:
    Sep 23, 2015
    Messages:
    352
    Likes Received:
    120
    ttsengines is a Sangoma commercial module and therefore not part of IPBX.
     
    Jose Casares likes this.
  3. Nubleet

    Nubleet New Member

    Joined:
    Nov 16, 2015
    Messages:
    17
    Likes Received:
    0
    Any update on this? I am getting
    Code:
     googletts-cli.pl -o /tmp/tts/test.wav -t "Things and stuff that needs to be said"
    Failed to fetch speech data. at /usr/local/sbin/googletts-cli.pl line 126.
    
     
  4. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,012
    Likes Received:
    2,344
    This seems to be an endless battle so we are moving the News and Weather apps to FLITE. Here's the patch for those that need it.

    Code:
    # patch to replace GoogleTTS with FLITE since GoogleTTS is dead meat
    sed -i '\:// BEGIN nv-news-yahoo:,\:// END nv-news-yahoo:d' /etc/asterisk/extensions_custom.conf
    echo ';# // BEGIN nv-news-yahoo
    exten => 951,1,Answer
    exten => 951,n,Wait(1)
    exten => 951,n,Set(TIMEOUT(digit)=7)
    exten => 951,n,Set(TIMEOUT(response)=10)
    exten => 951,n,Flite("Please hold a moment while we retrieve the latest Yahoo news headlines.")
    exten => 951,n,AGI(nv-news-yahoo.php,10)
    exten => 951,n,Flite("${NEWS}")
    exten => 951,n,Hangup
    ;# // END nv-news-yahoo
    ' > /tmp/news.txt
    sed -i '/\[from-internal-custom\]/r /tmp/news.txt' /etc/asterisk/extensions_custom.conf
    rm -f /tmp/news.txt
    sed -i '\:// BEGIN nv-weather-google:,\:// END nv-weather-google:d' /etc/asterisk/extensions_custom.conf
    echo ';# // BEGIN nv-weather-google
    exten => 949,1,Answer
    exten => 949,n,Wait(1)
    exten => 949,n,Set(TIMEOUT(digit)=7)
    exten => 949,n,Set(TIMEOUT(response)=10)
    exten => 949,n(retryw),Flite("After the beep say the city and state or province of the weather report you wish to retrieve. Then press pound.")
    exten => 949,n,agi(speech-recog.agi,en-US)
    exten => 949,n,Noop(= Script returned: ${status} , ${id} , ${confidence} , ${utterance} =)
    exten => 949,n,GotoIf($["${confidence}" > "0.4"]?proceedw:retryw)
    exten => 949,n(proceedw),Flite("Please hold a moment while we retrieve your report for ${utterance}.")
    exten => 949,n,AGI(nv-weather-google.php,${utterance})
    exten => 949,n,NoOp(Forecast: ${WEATHER})
    exten => 949,n,Flite("${WEATHER}")
    exten => 949,n,Hangup
    ;# // END nv-weather-google
    ' > /tmp/weather.txt
    sed -i '/\[from-internal-custom\]/r /tmp/weather.txt' /etc/asterisk/extensions_custom.conf
    rm -f /tmp/weather.txt
    asterisk -rx "dialplan reload"
    
     
    Trimline2 likes this.
  5. Trimline2

    Trimline2 Guru

    Joined:
    May 23, 2013
    Messages:
    494
    Likes Received:
    92
    Well, I'm keeping my head down on this one - I just installed a new system that went production on 9/1 and I'm not experiencing any issues with Google TTS. Both News and History (patched) work just fine; I've always run Weather with Flite.
     
  6. chris_c_

    chris_c_ Active Member

    Joined:
    Aug 19, 2010
    Messages:
    399
    Likes Received:
    57
    The googletts-cli.pl is working fine here now. Here's the resulting .wav file to listen to.
    http://www.espacenetworks.com/media/audio/test.wav

    Instead of hard switching over to FLITE, why not first try googletts-cli.pl, if it fails, then try picotts, if that fails, then try FLITE.

    Because at one time or another, each of them can all fail. Yet it's unlikely for all 3 to fail at the same time.
     
  7. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,012
    Likes Received:
    2,344
    Here is the latest set of patches for GoogleTTS from Lefteris Zafiris:
    Code:
    cd /tmp
    git clone https://github.com/zaf/asterisk-googletts.git
    cd asterisk-googletts
    mv goo* /var/lib/asterisk/agi-bin/
    chown asterisk:asterisk /var/lib/asterisk/agi-bin/*.agi
    cd cli
    mv googletts-cli.* /usr/local/sbin/.
    chmod +x /usr/local/sbin/googletts*
    cd /tmp
    rm -rf asterisk-googletts
    
     
    chris_c_ likes this.
  8. Chakravarty

    Chakravarty New Member

    Joined:
    Jun 15, 2017
    Messages:
    11
    Likes Received:
    1
    Hi there - On my PIAF Green I don't have the propolys-tts.agi file. Can I simply install it by adding the propolys-tts.agi file (from https://git.freepbx.org/projects/FREEPBX/repos/tts/browse/agi-bin/propolys-tts.agi) to the directory: /var/lib/asterisk/agi-bin/
    chown asterisk:asterisk /var/lib/asterisk/agi-bin/*.agi

    But don't I need something in my /usr/bin directory?
    I am trying to follow the instructions to add a Polly TTS as shown here - https://community.freepbx.org/t/tts-engine-custom-amazon-polly-24-languages/40763

    Many thanks for any guidance!
     

Share This Page