question

Probably Not Groot avatar image
Probably Not Groot asked

Alexa isn't playing my stream -- any ideas?

Hey Folks,

As the subject might suggest, I'm having a hell of a time getting Alexa to stream an MP3 file. I've hardcoded the results I send (see below), and as far as I can see that's what's being sent down the wire. But when I launch my intent Alexa just spins blue then briefly green, and then stops. No response, no "problem playing the stream", etc.. Any thoughts?

Here's what I'm sending down the pipe (as seen in the logs just before sending it):

{
  "version": "1.0",
  "response": {
    "shouldEndSession": 1,
    "response": {
      "outputSpeech": {
        "text": "Playing Somgwriters island",
        "type": "PlainText"
      },
      "directives": [
        {
          "playBehavior": "REPLACE_ALL",
          "audioItem": {
            "stream": {
              "url": "http://la2-ssd.myautodj.com:8198/stream.mp3",
              "token": "",
              "offsetInMilliseconds": 0
            }
          },
          "type": "AudioPlayer.Play"
        }
      ],
      "reprompt": {},
      "card": {}
    }
  },
  "sessionAttributes": {},
  "statusCode": "200"
}
alexa skills kitintentsresponse
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Probably Not Groot avatar image
Probably Not Groot answered

Meh, I figured it out. From the reference, audioItem.stream.url "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 Servicesoffering).

Wish I had known that in advance! Can anyone think of a way to proxya non-SSL stream through Amazon?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-f067fd05-2ee1-4332-83a6-e2b1533e47e2 avatar image
newuser-f067fd05-2ee1-4332-83a6-e2b1533e47e2 answered

Apparently you can have a ".m3u" file at the https site and in that "refer" to a non https site that hosts the mp3 - not tried it yet myself - but give it a go and tell us what issues there are.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.