Author Topic: Introducing the Sonos Plugin  (Read 6654 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Introducing the Sonos Plugin
« on: June 06, 2015, 05:13:58 PM »
The first alpha of the Sonos plugin is included in VoxCommando version 2.1.4.8
http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2.1.4.8

This release also includes a sample default configuration with many commands in it for controlling your Sonos players and groups.

Both the plugin and the configuration are still in the very early stages.  AKA "alpha".  Some things are working perfectly in my test so far but there is probably a long way to go still before we can call it a finished product.

A few very important notes about the plugin:

To use TTS with Sonos:

1 - You must choose a voice and a valid Sonos share in the plugin settings in order to use TTS with Sonos.  A valid share is a network path that both VoxCommando and Sonos can freely access.  VoxCommando must have write access to the share in order to be able to save a wav file containing the TTS audio.

2 - You cannot use the same TTS voice in the Sonos plugin as you are using in the standards TTS plugin for VC.  I am still trying to figure out the best solution for this problem.  We will figure something out eventually, but for now we will have to live with this limitation.
* see below

3 - Sonos can sometimes be a bit slow to switch between playing one thing and playing another thing.  For this reason you may not want to overdo it with the TTS.  Especially if you are listening to radio streams.  Switching to and playing the TTS will probably be pretty quick but switching back to the original stream can take a while.

4 - In some cases your original content may not start playing after a TTS plays, or you may switch back but not resume on the same song.  For example if you are listening to Google Play Music on a smart playlist (e.g. I'm feeling lucky mix or Artist Radio), when you return to the playlist it will start playing a different song.  I don't know of any solution for this.

Getting started:

1 - I suggest you start with a fresh install of VoxCommando 2.1.4.8 in a blank folder and select the English / Sonos configuration to start with.
2 - Open the plugin settings for Sonos and make sure you have selected a player, and set the TTS settings as mentioned above.
3 - Do a GenXML.  This is done asynchronously because it may take a long time.  When the GenXML is complete it will generate an event in VoxCommando.  After that you can do a quick restart to rebuild the commands that use the payloads.

There are voice commands for playing artists, albums, genres, favourites, radio stations etc. but not to play individual songs.  This will probably not change, however you can create commands to play an individual song in a macro.  More on this later.

If you already have a Sonos, give it a whirl now!
http://voxcommando.com/home/downloads/

Please note that I will be away from "the office" for the next week.  I will be monitoring the forum from time to time but not doing any major work.
« Last Edit: June 29, 2015, 09:37:36 AM by jitterjames »

OklahomaGreyBeard

  • Contributor
  • ***
  • Posts: 54
  • Karma: 3
    • View Profile
Re: Introducing the Sonos Plugin
« Reply #1 on: June 06, 2015, 10:32:48 PM »
If you haven't seen it, in the options/plugins section when you mouse over the sonos plugin it shows the help text for the DirectX keyboard emulation plugin.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Introducing the Sonos Plugin
« Reply #2 on: June 07, 2015, 08:05:05 AM »
No I had not.  Thanks for the heads up.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Introducing the Sonos Plugin
« Reply #3 on: June 29, 2015, 09:35:25 AM »

2 - You cannot use the same TTS voice in the Sonos plugin as you are using in the standards TTS plugin for VC.  I am still trying to figure out the best solution for this problem.  We will figure something out eventually, but for now we will have to live with this limitation.

I recently discovered that this is only true with certain voices.  In my tests the Neospeech voices (Bridget and Paul) suffer from this problem, but none of my other voices including Anna, and the Ivona voices have any problems.

Since the Neospeech voices are my favourites I will still look into a solution.  It will probably involve some pretty significant changes to the TTS plugin to make sure the voice objects are destroyed when not being used.  This sounds simple enough but it isn't.

2exclusive

  • Contributor
  • ***
  • Posts: 54
  • Karma: 0
    • View Profile
Re: Introducing the Sonos Plugin
« Reply #4 on: July 10, 2015, 01:14:49 PM »
Hi James,

I am testing the Sonos plugin with the sonos.tts.speak action, I am unable to send the TTS through all speakers and then have it revert back where it left off.

in eventghost there is a notification restore option, which will revert back to the original setting once the notification completed. I believe you do the same in the background with the Sonos.TTS.Speak but unable to do this when incorporating all speakers. hope this makes sense.  perhaps a parameter can be added to Sonos.TTS.speak that you can list the speakers you want the voice to go through?


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Introducing the Sonos Plugin
« Reply #5 on: July 10, 2015, 02:35:18 PM »
Hi 2exclusive. Can you explain what you mean by "you are unable to"? What method (or methods) have you tried that don't currently work for you?

e.g.

Are you currently trying to use the "group" actions to create a group/zone in order to send TTS to all speakers?

Are you then using Sonos.SetLastPlayer after the TTS is sent to a group in order to try to revert back to a specific player/speaker, and that is not working to revert back to a specific player ?

etc.

TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

2exclusive

  • Contributor
  • ***
  • Posts: 54
  • Karma: 0
    • View Profile
Re: Introducing the Sonos Plugin
« Reply #6 on: July 10, 2015, 03:02:36 PM »
I have the following actions selected and no luck on getting it to work like EG. Maybe something to add in the future

In VC configuration

Sonos.PartyMode
Sonos.Player.SetGrpVol 50
Sonos.TTS.Speak     standing by
Sonos.SetLastPlayer
VC.Standby

In event ghost it looks like this and it works

Sonos: GroupZP's
Sonos: NotificationStart (see attached image of options for this)
Sonos: Notification TrackURI: \\192.168.11.8\VoxTTS\vox.wav
Sonos: NotificationRestore: 5 (this is the function that puts the setting back to original after 5secs)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Introducing the Sonos Plugin
« Reply #7 on: July 10, 2015, 03:09:19 PM »
You are not telling uswhat is actually happening as opposed to what you expect to happen.

Sonos.SetLastPlayer does not modify groups.

There is currently no way to to restore groups after party mode.  You must to do it manually.


2exclusive

  • Contributor
  • ***
  • Posts: 54
  • Karma: 0
    • View Profile
Re: Introducing the Sonos Plugin
« Reply #8 on: July 10, 2015, 03:23:23 PM »
what I am trying to accomplish is the following?


Example 1.

lets say i am playing music in one zone, and i ask VC a question, he responds through all speakers then reverts back to the one zone and continues playing music.


Example 2.

lets say I am not listening to any music and I ask VC a question, he responds through all speakers.


with EG configuration I am able to achieve this, with VC I am unable to get this going. So my question was how can i accomplish this?  I do not see a restore option in your sonos plugin similar to how EG plugin has.

I hope this is clear, sorry for the confusion.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Introducing the Sonos Plugin
« Reply #9 on: July 10, 2015, 04:50:07 PM »
Yes it's clear.  And now that I understand, your original post was already pretty clear.  Funny how that works.  :bonk

I will need to think about this.  Probably I will start with a method to take a snapshot of all machine groupings and what they are playing, and later we can restore it.  It gets a bit stickier when we start to consider overriding and restoring volume etc.

Be advised that the action to SetGroupVolume works the same as adjusting the group volume in Sonos.  That is, when you set the group volume to 50, it does not set each player to 50, it adjust all players up or down equally, maintaining their relative volumes, so that the average group volume becomes 50.  This could be somewhat disastrous if you have a group where player A had a volume = 65 and player B had a volume = 1.

Setting the group volume to 50 would result in A = (65+28) =93 and B = (1+28) = 29

2exclusive

  • Contributor
  • ***
  • Posts: 54
  • Karma: 0
    • View Profile
Re: Introducing the Sonos Plugin
« Reply #10 on: July 10, 2015, 05:21:58 PM »
understood, maybe you can add an option for Sonos.TTS.notification that you can select which "players" tts plays to, also specify the volume so its consistent across all speakers, another option to UN-mute speakers and then a restore to previous setting when done. similar to EG sonos plugin.

This would be very helpful

by the way, the sonos plugin is really working nicely. I like some of the logic you added to it, really an awesome addition to VC.



tvamvaki

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: Introducing the Sonos Plugin
« Reply #11 on: July 14, 2015, 10:30:42 AM »
Awesome plugin, great work. Quick question though, is there a way to un-unute the speakers? I have tried to change the volume however this doesn't unmute...

Thanks in advance!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Introducing the Sonos Plugin
« Reply #12 on: July 14, 2015, 11:01:54 AM »
Glad you're enjoying the new plugin, even in its alpha state.

Thanks for pointing that out. You're right, it seems it isn't possible to mute/unmute using the set/adjust volume actions.

James is currently concentrating on some other aspects of the program but it shouldn't be too long before the next update to the Sonos plugin can be released. I believe there will be a few new Sonos features added to the mix at that point.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

tvamvaki

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: Introducing the Sonos Plugin
« Reply #13 on: July 14, 2015, 11:04:27 AM »
Glad you're enjoying the new plugin, even in its alpha state.

Thanks for pointing that out. You're right, it seems it isn't possible to mute/unmute using the set/adjust volume actions.

James is currently concentrating on some other aspects of the program but it shouldn't be too long before the next update to the Sonos plugin can be released. I believe there will be a few new Sonos features added to the mix at that point.


No problem! Working pretty well for an Alpha... I thought i'd ask the question just in case i was missing something...  :)