Author Topic: "Duration" issue when returning to now-playing music  (Read 675 times)

Offline DeltaNu1142

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +40/-67
"Duration" issue when returning to now-playing music
« on: February 26, 2016, 10:17:28 am »
I'm using the following code as an example of an announcement that Vera makes through my Sonos devices:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say",
                 {Text="The Front Door has been left unlocked.",Language="en-CA",Duration=3,GroupZones="ALL",Volume=50},234)

My impression of the "Duration=3" parameter is that, if music is playing, the music will resume after the announcement is made. Well... it does, but it's not actually the same song. It's as if Sonos stops for the announcement, then makes the announcement, and then Sonos just restarts whatever channel was playing before the announcement. It's always a new song.

Is this how it's supposed to work?
Vera 3 @ UI5 | HomeWave | PLEG

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: "Duration" issue when returning to now-playing music
« Reply #1 on: February 28, 2016, 04:02:35 am »
Please look at the wiki, the duration is not a parameter for the Say action.
The previous playback context is restored after TTS. Depending on this context (the music service you are listening), it will continue the previous song or switch to a new one. For example, with Deezer flow, a new song is played but with a particular song from your local music library or even Deezer, the song is restarted at its previous position. If the song is put in the queue, it is working.
« Last Edit: February 28, 2016, 04:07:11 am by lolodomo »

Offline DeltaNu1142

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +40/-67
Re: "Duration" issue when returning to now-playing music
« Reply #2 on: February 28, 2016, 08:12:43 am »
Ah hah, thanks. I used the "duration" parameter when calling up an MP3, and so I assumed it would work for the "Say" command as well. So whether the interrupted music will continue or restart is entirely dependent on the context... got it.
Vera 3 @ UI5 | HomeWave | PLEG