groupVolume

setVolume

Use the setVolume command to set the group volume and the group's mute state. The group is automatically unmuted unless otherwise specified.

When your app sets the group volume, the group coordinator calculates the required changes to the volume level for each player in the group so that the result is the average volume level of the group as a whole. The group coordinator then adjusts its local volume and initiates network transactions with the other players in the group to adjust their volumes accordingly. While players adjust their volumes, the group coordinator may generate one or more groupVolume events.

Since this command can generate additional network transactions and events, your app should optimize how often it is invoked to maintain a good user experience without flooding the network, such as when implementing a touch screen volume slider that controls a group of five players.

If every player in the group has a fixed player volume state that is true, the group volume cannot be changed, so the command will fail and you will receive an ERROR_COMMAND_FAILED globalError. The groupVolume event reports this case with a fixed value of true.

post/groups/{groupId}/groupVolume

Request

  • Base URL
    https://api.ws.sonos.com/control/api/v1
  • URL
    https://api.ws.sonos.com/control/api/v1/groups/{groupId}/groupVolume
  • Auth
    OAuth 2 and HTTP bearer and API key in header X-Sonos-Api-Key
    Authorization code: https://api.sonos.com/login/v3/oauth
    Token URL: https://api.sonos.com/login/v3/oauth/access scopes: playback-control-all

Request body

volumeinteger required

The new group volume as an integer between 0 and 100, inclusive. Values above this range will be rejected. Any negative value will be interpreted as setting the group volume level to 0.

Response

See the x-muse-error-codes extension for a list of muse errors that generate this response

Ok required

This object represents an empty (default) success. The platform returns an empty object ({}).

Changes

No recorded changes to this operation across all 1 revision of this API.