0

I'm new to Alexa development. I created an Alexa skill hooking up to an AWS lambda function that uses Nodejs.

My goal for this skill is to find out what the album of the day is based on a feed I have (done) and read a blurb about it (done) and play the album.

My simple intents that get data and read it aloud are working. But I can't figure out how make the "play" intent work.

If the album of the day is "Witness by Katy Perry", I want the user to say "alexa, ask (myskill) to play the album of the day" and it would respond with "Playing Witness by Katy Perry" and begin playing that album.

Is this possible??

Thank you!

Deez
  • 43
  • 1
  • 5

1 Answers1

0

You can use SSML type with <audio src="..."/> of outputSpeech in a response. Example of a response:

"response": {
  "outputSpeech": {
    "ssml": "<speak> Playing 'Witness by Katy Perry':  <audio src="https://.../output.mp3" /> </speak> ",
    "type": "SSML"
  },
  ...
}

But it has a limitation: audio file can't be longer than 90 seconds. Requirements about mp3 file can be found here. As a workaround maybe you can split mp3 file on chunks of 90 seconds duration.

To prepare mp3 file for Alexa you can use the following command from terminal (it converts from input.mp3 to output.mp3):

ffmpeg -y -i input.mp3 -ar 16000 -ab 48k -codec:a libmp3lame -ac 1 output.mp3
Vasyl Sarzhynskyi
  • 3,689
  • 2
  • 22
  • 55
  • I would like to use the built in Amazon catalog to play albums - as they should all exist. – Deez Oct 22 '17 at 20:07
  • Meaning, I would like to give Alexa a command to play "Witness by Katy Perry" from its catalog. Speaking the "Playing 'Witness by Katy Perry'" isn't that important... I'd rather figure out how to actually send the command to play it. – Deez Oct 23 '17 at 18:09