user2526112
user2526112

Reputation: 1

Add players to existing group without pausing music?

I've been using the Android example project to control Sonos in Java. I've tried using multiple API-calls to group multiple players but every time the music pauses after adding/removing players. I tried:

createGroup, modifyGroupMembers & setGroupMembers

When using createGroup, I've succesfully added the musicContextGroupId parameter to keep the music in the new group, but it still pauses.

Any ideas?

Upvotes: 0

Views: 204

Answers (1)

Stephan
Stephan

Reputation: 2590

All sonos speakers also have a local control api (SMAPI), I've spend many hours documenting it.

If you just want to join one player to a group, you'll need the UUID of the coordinator (that is the player responsible for the queue). It's probably the player where you started from. The uuid looks like RINCON_AAAAAAAAAAAA01400

Then you send the SetAVTransportURI request to the player.

This is a raw http (POST) request, you can probably figure out how to send that in your desired language.

POST /MediaRenderer/AVTransport/Control
Host: 192.168.x.x:1400
soapaction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"
Content-Type: text/xml; charset="utf-8"

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <s:Body>
    <u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
      <InstanceID>0</InstanceID>
      <CurrentURI>RINCON_AAAAAAAAAAAA01400</CurrentURI>
      <CurrentURIMetaData></CurrentURIMetaData>
    </u:SetAVTransportURI>
  </s:Body>
</s:Envelope>

By controlling it locally you'll have the same experience as if you were using the official app. You can also check out one of these apps:

Upvotes: 1

Related Questions