I'm trying to build an Alexa skill that mimics the functionality of the NPR skill. For example, assuming that the invocation name is "NPR", the dialogue would look something like this:
So far, I have two slots {zip} and {city}. I have also made an intent named "ZiporCityIntent" that is supposed to catch the ZIP code or city that the user says. However, I am lost at this point and am not sure how to proceed. My goal is as follows:
I would appreciate any advice or guidance. Thank you for your time.
I'll try to answer each of your questions separately.
As an alternative to asking for zip code, you could use location services to fetch the user's device's location. You will have to get permission from the user though. https://developer.amazon.com/en-US/docs/alexa/custom-skills/location-services-for-alexa-skills.html
There is a slot type, however, for cities. (See AMAZON.US_CITY https://developer.amazon.com/en-US/docs/alexa/custom-skills/slot-type-reference.html#list-types )
Is there an API you can use that takes in a zip code or city and gives you back a list of radio stations (an object with name and streaming URL, I imagine)? If not, perhaps you can go the simple route of define this mapping in your code. If it's not a super large data set, I could storing this as a JSON file.
Look into the AudioPlayer interface. Make sure the media format is compatible. https://developer.amazon.com/en-US/docs/alexa/custom-skills/audioplayer-interface-reference.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.