Sonos speech

Posted on
Sun Dec 28, 2014 6:03 am
pocster offline
User avatar
Posts: 276
Joined: Nov 15, 2014

Sonos speech

Hey Nick!

Great update works pretty good!

A few issues. If the sonos is playing audio and then I do speech; once the speech ends it's mute. How do I get it to continue playing i.e. pause, speak, un pause.

Finally - how do I construct a string in python and pass that into sonos to speak? ; rather than a pre-generated string using the menu structure.

Looking good though!!

Happy Xmas and New Year!

Posted on
Mon Dec 29, 2014 10:25 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Sonos speech

+1 on constructing a Python string for custom speech. I currently use the variable substitution method but it would nice to inject something directly from Python.

Terry

Posted on
Mon Dec 29, 2014 10:29 am
pocster offline
User avatar
Posts: 276
Joined: Nov 15, 2014

Re: Sonos speech

Hey Terry,

I've no idea how you do what you say; can you elaborate please? - assume my knowledge is zero; as that's quite close :-))))

Posted on
Tue Dec 30, 2014 8:23 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos speech

Jay/Matt - I think this script should work, but am getting an error:

Code: Select all
SonosPlugin = indigo.server.getPlugin("com.ssi.indigoplugin.Sonos")
if SonosPlugin.isEnabled():
   SonosPlugin.executeAction("actionZP_announcementMP3", props={'zp1':indigo.devices['Cave'].id,'ttsORfile':"TTS",'setting':"Hello",'language':"en",'zp_volume':"30"})

When I execute, I get the following:

Code: Select all
  Sonos Error                     plugin does not have a <CallbackMethod> specified for action id actionZP_announcementMP3
  Script Error                    embedded script: IllegalParameterError -- plugin does not have a <CallbackMethod> specified for action id actionZP_announcementMP3
  Script Error                    Exception Traceback (most recent call shown last):

     embedded script, line 3, at top level
ValueError: IllegalParameterError -- plugin does not have a <CallbackMethod> specified for action id actionZP_announcementMP3

Any ideas?

roussell wrote:
+1 on constructing a Python string for custom speech. I currently use the variable substitution method but it would nice to inject something directly from Python.

Terry

Posted on
Tue Dec 30, 2014 1:10 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Sonos speech

What does the Actions.xml look like for actionZP_announcementMP3? Or maybe that is the problem – you have to define an action in the Actions.xml then that specifies the python callback that gets called.

Image

Posted on
Tue Dec 30, 2014 1:44 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos speech

You are brilliant! I actually had a typo in the Action id in the Actions.xml file. Made a quick change and it is working as expected. This will be out in the next release.

Thanks Matt!

matt (support) wrote:
What does the Actions.xml look like for actionZP_announcementMP3? Or maybe that is the problem – you have to define an action in the Actions.xml then that specifies the python callback that gets called.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest