Reputation: 14551
I would like to develop a simple Alexa skill which should do only one thing.
By invoking it with:
Alexa, play Radio Luxembourg
it should play http://sc-rtllive.newmedia.lu
I found examples how to play media files hosted on an external server, but none playing a stream.
Is it possible at all?
Edit
There is actually not really a need for this at all.
The built-in TuneIn
-support can do that for you.
Provided you pronounciation is good (I never seem to get it right), this should work:
Alexa, play RTL Radio Lëtzebuerg on tunein
Upvotes: 2
Views: 5419
Reputation: 21
I pretty much copied and pasted this code into a Lambda function (1m requests per month via the free tier is plenty) and just changed the podcastURL:
https://github.com/bespoken/super-simple-audio-player/blob/Part1/README.md
The instructions in the README talk about setting up bespoken-tools, which indeed are great for debugging, but if you want to run it independently of your own machine, can use their code in Lambda. Their guide to setting up the Alexa skill with Amazon will work perfectly, with the exception that your HTTPS endpoint for the service will be the Lambda endpoint, not your own box. Here's some basics on Lambda: https://docs.aws.amazon.com/lambda/latest/dg/getting-started.html
The only issue, as @Tiantian correctly points out, is that the Radio Luxembourg isn't HTTPS. Maybe you can proxy it or something. Looks like this would do the trick: https://webrobots.io/how-to-setup-a-free-proxy-server-on-amazon-ec2/
(You'd want to restrict that so it only proxies traffic to the Radio Luxembourg link.)
Upvotes: 2
Reputation: 301
Based on this :https://developer.amazon.com/docs/custom-skills/audioplayer-interface-reference.html#play
Identifies the location of audio content at a remote HTTPS location. The audio file must be hosted at an Internet-accessible HTTPS endpoint. HTTPS is required, and the domain hosting the files must present a valid, trusted SSL certificate. Self-signed certificates cannot be used. Many content hosting services provide this. For example, you could host your files at a service such as Amazon Simple Storage Service (Amazon S3) (an Amazon Web Services offering).
The supported formats for the audio file include AAC/MP4, MP3, HLS, PLS and M3U. Bitrates: 16kbps to 384 kbps.
Upvotes: 4