Page 10 of 10

Re: SONOS Plugin Official (download here)

Posted: Fri Sep 23, 2016 12:45 pm
by eirik226
techoguy wrote:Hi Eirik226,

Thanks!

To get the album are, refer to the post right before yours. It goes over how to get the cover art. You basically have two options, you can receive the event with the URL to the sonos player cover art or you can have the plugin save the image to a local folder. This can then be displayed on your web page. Basically the event will show up anytime the media changes.
Thanks for your reply! This gave me a few ways to try out - seems like I will be dropping the song timer and maybe just display the song name and album art (If I can get it up and running) - I will look at the post right before mine. Yet again, thanks for the help :)

Re: SONOS Plugin Official (download here)

Posted: Wed Sep 28, 2016 6:10 am
by eirik226
Hello again,

Quick question. I've added a slider on my eventghost webserver to control the volume of the sonos player. I've managed to get the value of the slider to eventghost, but have troubles updating that value to sonos. Right now I use this script, but it does not work, any idea what to change?

Code: Select all

suffix = eg.event.suffix;
try :
    volume = int(suffix[suffix.find(".")+1:]);
except Exception:
    volume = 0;
else:
    eg.plugins.Sonos.VolumeSet(volume);
Thanks in advance! *Artwork next, uugghh*

Edit: I've found out how to do it now. But I still can't get it to work, I don't understand how I specify what player the VolumeSet is going to.

So basically it's " eg.plugins.Sonos.VolumeSet-THE PLAYER HERE(volume); But do I put it after a "." or ":" or ()". Think i've tried it all, sorry that I can't figure this out myself -.-

Edit2: With some help from Walter I got this working now :)

Re: SONOS Plugin Official (download here)

Posted: Mon Oct 10, 2016 2:03 pm
by eirik226
EDIT: It was my fault - with some great help from yokel22 I got everything up and running - even better then I could imagine! :)

Re: SONOS Plugin Official (download here)

Posted: Sun Oct 30, 2016 2:47 pm
by eirik226
Hey again,

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?

Thanks in advance!

Re: SONOS Plugin Official (download here)

Posted: Tue Nov 01, 2016 6:51 pm
by techoguy
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.

Re: SONOS Plugin Official (download here)

Posted: Wed Nov 09, 2016 3:49 pm
by eirik226
Sorry for the late reply - I've been away for some time. I'll look into this tonight! :)

Edit: Thank you of course!

Re: SONOS Plugin Official (download here)

Posted: Mon Dec 12, 2016 8:08 pm
by techoguy
eirik226 wrote:Sorry for the late reply - I've been away for some time. I'll look into this tonight! :)
Just curious, could you post a picture of your web GUI for the SONOS control? i'm interested to see how it all turned out.

Thanks!

Re: SONOS Plugin Official (download here)

Posted: Fri Dec 16, 2016 3:46 pm
by eirik226
Yes of course - but I would advise you to go and take a look at "WS-Demo" made by: Yokel22.

It's in the tutorial section, pretty cool stuff! I use his Sonos setup, just different CSS.