Learn R Programming

spotifyr (version 2.2.1)

set_my_volume: Set User Device Volume

Description

Set the volume for the user<U+2019>s current playback device.

Usage

set_my_volume(
  volume_percent = 50,
  device_id = NULL,
  authorization = get_spotify_authorization_code()
)

Arguments

volume_percent

Required integer value. The volume to set. Must be a value from 0 to 100 inclusive. Defaults to 50.

device_id

Optional. The id of the device this command is targeting. If not supplied, the user<U+2019>s currently active device is the target.

authorization

Required. A valid access token from the Spotify Accounts service. See the Web API authorization Guide for more details. Defaults to spotifyr::get_spotify_access_token(). The access token must have been issued on behalf of the current user. The access token must have the user-modify-playback-state scope authorized in order to control playback.

Value

The response from the Spotify Web API on the PUT request, with a meaningful error message if the operation was not successful.