alexa-samples/skill-sample-nodejs-audio-player

Play audio by asking by track title

Closed this issue · 1 comments

Hello,

Does anyone have an example on how to play audio from sources in AudioAssets.js by asking by title? For example, I have .pls files for radio stations I'd like to play. In AudioAssets.js, I have the radio station name in 'title' and the .pls link in 'url. This works with the sample code. If 'title' = 'My Favorite Radio Station', how do I make this work by saying, "Alexa, ask AudioPlayer to play title My Favorite Radio Station?

I'm learning a lot from playing with this skill, but I'm not advanced enough to figure this out. Any guidance would be greatly appreciated.

Some posts explain how to call by episode number. I hope someone can assist in taking this one step further. I'm looking to have a list of Internet radio stations and the user start playing a station by saying the name.

For example, if in audioAssets I have the following (URL's are fictional):

'use strict';

// Audio Source - Stations
var audioData = [
{
'title' : 'Talk Radio',
'url' : 'https://playerservices.streamtheworld.com/pls/talk_radio.pls'
},
{
'title' : 'Urban Music',
'url' : 'https://playerservices.streamtheworld.com/pls/urban_music.pls'
}

];

module.exports = audioData;

What would have to be done to have the player play the station by saying the title? I'd like the end result to be, "Alexa, ask AudioPlayer to play Urban Music" or any other name in the 'title' variable.

Any help in accomplishing this would be greatly appreciated!