Set Playback Volume
client.Me.Player.SetVolume(ctx, body) error
PUT/me/player/volume
Set the volume for the user’s current playback device. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.
Parameters
Set Playback Volume
package main
import (
"context"
"github.com/cjavdev/spotted-go"
"github.com/cjavdev/spotted-go/option"
)
func main() {
client := spotted.NewClient(
option.WithAccessToken("My Access Token"),
)
err := client.Me.Player.SetVolume(context.TODO(), spotted.MePlayerSetVolumeParams{
VolumePercent: 50,
})
if err != nil {
panic(err.Error())
}
}