Stream URL by station name on Alexa

Viewed 566

I'm developing an Alexa skill to support our radio app. We don't need to put the app itself onto Alexa, all we need is for Alexa to grab the station's URL and open it in its media player. I'm at the skill of development step where it says "ok, now just add your code to the lambda function" with zero explanation for what sort of things they want to code. Please help me to write a script that does the following.

User says, "Alexa, play $station on ". Alexa searches through our catalog to find the station with matching name. Alexa takes the URL from that item in our json file. Alexa opens the URL and plays the stream. Alexa says, "OK, playing $station on ."

And that's all it needs to do.

2 Answers

You could use the official example to deploy the code and follow the instructions: https://github.com/alexa/skill-sample-nodejs-audio-player/tree/mainline/single-stream

It seems you are hanging at the step in the developer console. You need to provide the endpoint where your code runs. It could run in amazon aws lambda for example but you need to create an account for this.

Update after comment

You have two possibilities:

  • Wether you resolve to your radio station with multiple intents.
  • Or you have just one intent in your skill with a slot.
    • These slots represent your radio stations.
    • I would prefer the solution with slots as it's easier to extend radio stations. If the stations have difficult names you could also read numbers for every station and let the user select a number for the station.
    • with slots you can even put different synonyms for your radio stations

But your speech, "Alexa, play $station on " would not be possible. Just "Alexa start mysuperduperplayer with station XYZ"

Related