eirik226 wrote:No rush, but no matter what I do I can't get the google text to speech part of this plugin working. I've googled a bit, and the reason behind this is google has added Captcha to their URL? Do you know of any good way around this or any other solution's? I did read about making sonos play a local .wav file you can create, but that seems a bit advanced for something that should be easy, or am i wrong?
sorry for not replying earlier, i don't always get notifications that someone has responded to the thread.
I would love to see a screen shot or something of what you have running to see how it looks. I'm glad it's all working for you now too.
As for the google TTS, you are correct. Google added the Captcha, and they also started blocking servers like this before that.
I currently do this by using espeak.exe Text to speach and have it output to a wave file instead of the speakers then the Sonos player plays that wave file. You could also create the wave file if it's always the same and just play the wave file.
The espeak.exe TTS is a little more complicated and I'm currently doing that with some python code.
Here is how i do it:
1) Sonos NotificationStart
2) Python Script (see code below)
3) NotifiationTrackURI (" x-file-cifs://HTPC-WIN8/EventGhost/testingTTS.wav") adjust name to your server and wav file set in the python script)
4) Sonos NotificationRestore (adjust time to what you need)
Python Code:
Code: Select all
import subprocess
def textToWav(text,file_name):
subprocess.call(["C:\Program Files (x86)\eSpeak\command_line\espeak.exe", "-wven+m1"+file_name+".wav", text])
textToWav('Hello, welcome to my home,,.. My name is Aurora and Im the voice of the house','testingTTS')
#C:\Users\shock_000\AppData\Local\VirtualStore\Program Files (x86)\EventGhost
#now I need to have SONOS play this specific url.
#x-file-cifs://HTPC-WIN8/EventGhost/testingTTS.wav
You just have to make sure the "testingTSS.wav" file is shared with the network and accessible to Sonos. The Last step is just a time delay, so you have to adjust that as low as possible without chopping off the end of the audio.
You could also just create the wave file and not use espeak or the python code, but the other steps would be the same.