Jan 7, 2021

Create Alexa AudioPlayer Skills with PHP

Custom Music Player is a Convoworks service template that allows us to create playlists with our own music and plays mp3 files on devices such as Amazon Alexa or Google Assistant. You can follow instructions on how to create your own Custom Music Player in this walkthrough.

Requirements

You need an Amazon Alexa device (with or without display) or a Google Assistant device (also with or without display) to be able to run the Custom Music Player. Devices with a display have more options than devices without a display. For example, on a device with a display, we can see the current song name, artist, folder name, and press pause, next song, and previous song. Devices without display do not have this capability to preview the song name, artist, and so on.

Getting started

Invoking the service

When we have our service enabled, we just need to start the service with a simple invocation.

Example: “Alexa, open custom music player“
Example: “Hey Google, open custom music player“

Playing

After we enter the service, the welcome message is being read. Next, we need to say one of the utterances.

Example: “play Poker Face by Lady Gaga”
“play a song by Katy Perry”
“play songs in Rock playlist”
“play songs from Pop”

Or we can just say “play a song” to start playback from the beginning of the playlist.

Search in the service

Searching the playlist is also possible. We just need to say one of the utterances.

Example: “Alexa, ask custom music player to play Bad Romance by Lady Gaga”
“Alexa, ask custom music player to play a song by Britney Spears”
“Alexa, ask custom music player to play songs in Folder2 playlist”
“Alexa, ask custom music player to play songs from Rock”

Example: “Hey Google, ask custom music player to play Bad Romance by Lady Gaga”
“Hey Google, ask custom music player to play a song by Britney Spears”
“Hey Google, ask custom music player to play songs in Folder2 playlist”
“Hey Google, ask custom music player to play songs from Rock”

If the specified song does not exist, the service will tell us that the song is nonexistent and then we can say another song to search for it. After a song is found, the service starts playing it.

Exit the service

When we want to exit the service, we just need to say Stop or Cancel.

Example: “Alexa, stop”
“Alexa, cancel”

Example: “Hey Google, stop”
“Hey Google, cancel”
“Hey Google, exit”

Continue playback

When we want to play the last song that was played after we exited the service, we just need to say one simple utterance and the service will start to play that song.

Example: “Alexa, ask custom music player to continue playback”
Example: “Hey Google, ask custom music player to continue playback”

Command list

Here is the list of commands that are used in Custom Music Player.

  • Help – gives the user instructions on how to use the service
  • Next – lets the user navigate to the next song in a playlist
  • Previous – lets the user go back to the previous song in a playlist
  • Pause – lets the user pause the song that is playing
  • Resume – lets the user resume or continue the song that is paused
  • Repeat – lets the user repeat the current song from the beginning
  • Start over – lets the user restart the song that is playing
  • Stop/Cancel – stops playing the current song that is playing and exits the service
  • Go home/Navigate home – is active only on  display devices where it exits the service and returns customers to the home screen (works only with Amazon Alexa)
  • Shuffle on/off – lets the user shuffle the songs in a playlist (coming soon)
  • Loop on/off – lets the user loop through a playlist after the last song is finished (works only with Amazon Alexa)
  • Continue playback – lets the user play the song that was last played on the device (it is used when entering the service)