Google translate https://www.domoticz.com/wiki/Google_voice has changed resulting error 503 when using script from Wiki. Browser shows a captcha dialogue now.
To get it working again, a string "&ie=UTF-8&total=1&idx=0&client=t" must be added to the script.
My current script for speaking Domoticz is now:
If you try your string (from same network as your Domoticz) http://translate.google.com/translate_t ... 0&client=t in browser, do you get it spoken and without captcha?
My error was 503, not 403. Without the added part, do you get 503?
is there someone who can create a working google_voice.sh file and a sample script_device_switch.lua?
i have sound working on my rpi (can play a mp3 file with mplayer) but google.translate produces no sound even when the script is triggered.
So i think my google_voice.sh and script_device_switch isnt correct.
Could not get it working with google text to speech because google blocks my ip after one request.
So I had to find another solution. Now it works with the voicerss api.
BobbyNL wrote:is there someone who can create a working google_voice.sh file and a sample script_device_switch.lua?
i have sound working on my rpi (can play a mp3 file with mplayer) but google.translate produces no sound even when the script is triggered.
So i think my google_voice.sh and script_device_switch isnt correct.
What happend on command line (no script) if you produce the mp3 file and step 2 play it with mplayer?
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
pi@raspberrypi ~/domoticz/scripts $ sudo ./google_voice.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1771 100 1771 0 0 3495 0 --:--:-- --:--:-- --:--:-- 4052
Creating config file: /root/.mplayer/config
MPlayer svn r34540 (Raspbian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing google_tts.mp3.
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
libavformat file format detected.
[mp3 @ 0xb5da2850]Header missing
[mp3 @ 0xb64800e8]Could not find codec parameters (Audio: mp3, 0 channels, s16)
[mp3 @ 0xb64800e8]Estimating duration from bitrate, this may be inaccurate
LAVF_header: av_find_stream_info() failed
Exiting... (End of file)
And opening the mp3 file. Looks clear to my that the server blocks my IP even with this mp3 (solution)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="viewport" content="initial-scale=1"><title>http://www.google.com/</title></head>
<body style="font-family: arial, sans-serif; background-color: #fff; color: #000; padding:20px; font-size:18px;" onload="e=document.getElementById('captcha');if(e){e.focus();}">
<div style="max-width:400px;">
<hr noshade size="1" style="color:#ccc; background-color:#ccc;"><br>
<div style="font-size:13px;">
Our systems have detected unusual traffic from your computer network. Please try your request again later. <a href="#" onclick="document.getElementById('infoDiv0').style.display='block$
<div id="infoDiv0" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">
This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the <a href="//www.google.com/policies/terms/">Terms of$
</div><br>
IP address: xx.xxx.xx.xx<br>Time: 2015-11-01T16:26:59Z<br>URL: http://www.google.com/<br>
</div>
</div>
</body>
</html>
Google voice controls the number of call per IP. So if you have a dynamic IP, and are not lucky, you may be banned.
If so, use VoiceRSS. I have updated the wiki with a VoiceRSS howto, look here : https://www.domoticz.com/wiki/Talking_Domoticz