Spotify Plugin - AmyAssist/Amy GitHub Wiki

Plugin info

This plugin provides the most important functions to use Spotify. The existing functionalities make it possible to play your own playlists, the featured playlists and change between your connected devices.
Of course the most important music player features like play, pause, resume, skip, back and a volume control are also implemented.
To setup the connection to your Spotify account you have to create the login link first.

All these features are also available in our Web app.

How to setup

Connect your Spotify account

You have to connect your Spotify account once before you are able to use this feature. This works best in our Web app. You can press the send button without fill out the text fields if you have a config file for spotify with client secret and client id. Optional you can enter your ClientID and the ClientSecret and press now on the send button. Now you get a link. Open this in new browser window and follow the instruction. After the login you get a link with a token. copy and paste this in the text field in the web app and press the sen button.
The link has following structure: http://localhost:8888/?code=CODE&state=... Paste only the CODE part.

How to create a config file

For this plugin you need a client secret and client id from an spotify developer accont. For more infos see here. Put this keys in a text file is described as follows:
create a new text file in Amy\configwith the nameio.github.amyassist.amy-plugin-spotify.properties`. Open the file with a text editor and put following text in the file:

spotify_clientId=YOUR-ID
spotify_clientSecret=YOUR-SECRET

Plugin features

The following segments will explain the various features the plugin provides. The commands presented will have agf form as there are sometimes too many possible alternatives for one command to list them entirely. For all possible command variation see in spotifySpeech.xml You can read all about the agf form and dialogs here.

Player features

Here are all possible speech commands listed for the Spotify music player.

  • play some music This command starts to play music.
  • pause This command pauses the playing music.
  • resume This command resumes the paused music.
  • skip This command skips your actual track and continues with the next track.
  • back This command gets you back to your previous track and plays it again.
  • set music volume (mute|max|up|down) This command lets you control the volume of the Spotify player. This volume control influences only the Spotify player volume and works independently from your device volume.
  • set music volume to 30 % alternative to the previous command to set the volume with a percent value

Playlists

Amy can play all your personal playlists and the featured playlists provided by Spotify.
The speech command for Amy to get the featured playlists is get featured playlists. You will recieve a numbered list with all the featured playlistst where you can choose from with the command play featured playlist ID.
This works similar with your own playlists. Thee speech command for Amy to get your own playlists is get own playlists. You will also recieve a numbered list wih all your own playlists. To choose the desired playlist the command play own playlist ID has to be used.
The ID stands both times for the number of your playlist.

Device control

If you have multiple devices connected to your Spotify account you can switch between them. get music devices is the command to list all your connected devices. After getting all your connected devices you can select the desired device with the command set music device to ID. You can set your device alternatively with the device name with following dialog: First command: set music device by name, Second Command: 'DEVICE-NAME'

Play a song, album, playlist or artist

you can search and play a song, album, playlist or artist directly with following command:

  • play this song|album|playlist|artist NAME

A alternative is the dialog option:

  • First command: play following song|album|playlist|artist
  • Second command: NAME