Pause playing track and play local file and then resume.
356 views
Skip to first unread message
Hans P Nyholm
unread,
Feb 19, 2016, 6:29:27 AM2/19/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SoCo - Sonos Controller
I'am writing a script that I will pause the current playing track and play a localfile and then resume playing the current track and the rest of the queue or playlist.
I can play a local file, thats working. But the rest...
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SoCo - Sonos Controller
Hi Hans,
use the snapshot class in SoCo.
This saves all current state and then allows you to restore it.
Example:
# Snapshot of current state
from soco import SoCo
from soco.snapshot import Snapshot
zp = SoCo('192.168.1.76')
snap = Snapshot(zp) # create snapshot class
snap.snapshot() # take a snapshot of current state
# play your local file
snap.restore()
Have fun
Cheers Daivd
Hans P Nyholm
unread,
Feb 23, 2016, 4:47:10 PM2/23/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SoCo - Sonos Controller
Thank you, that works great.
I also have problem whit the Swedish letters å,ä,ö in the speaker names.
It can discover the speaker and print the name but i cant use a name whit å,ä,ö in it.
Kenneth Nielsen
unread,
May 5, 2016, 6:28:14 AM5/5/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SoCo - Sonos Controller
Hallo Hans
I realize this thread is a bit old, but thought I should answer anyway. Whan you say that you can't use speaker names with special Swedish letters in them, then what exactly do you mean? That you cannot set a new player_namer that contains these? (I'm a Dane myself, so I know of the special letters). When you test this, make sure you pass in the new name as a unicode string (Should happen automatically on Python 3, on python 2 use