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

An Alexa Skill Sample showing how to play long form audio in 3P-skills
Other
470 stars 319 forks source link

Stream not playing on device only 'welcome to my radio' #63

Closed simonravel closed 6 years ago

simonravel commented 6 years ago

Hi,

I deployed the single stream without changing any of the original files. I tested it on my device (Sonos One) and it responded with 'welcome to my radio', but the stream did not play after it. The music that was originally playing restarted again then. I tested the skill on the testing simulator (beta) and I didn't notice something strange expect for expirytime, which was set to: "expiryTime": "1969-12-31T23:59:59+0000" Could this be causing the problem?

Thanks

jeremywj commented 6 years ago

Same issue here. All I hear is "welcome to my radio"

sebsto commented 6 years ago

Hello,

Sonos ONE device does not support skills playing long form audio. This is a well known issues on Sonos One that should be addressed any time soon.

Can you try again and report status here ?

Thanks

simonravel commented 6 years ago

Hi Sébastien,

I tried again, but still no succes. (Or do you want a more detailed report status?) What is the difference between a long form and a short form audio, maybe I can try with a short audio file?

Thank you very much!

sebsto commented 6 years ago

Regarding Sonos ONE, I will check with the team and update this thread.

Long form audio = skills sending Audio Player directives. For example (in the UK) : BBC, Radio Player, Maxi80 and this example skill.

Short form audio = MP3 embedded in SSML answer. Limited to 90 sec playback.

Cheers

billdawgcbc commented 6 years ago

I am having this same issue and I’m not using Sonos. It will not play the stream just play the generic welcome message.

jeremywj commented 6 years ago

I am not using sonos either.

sebsto commented 6 years ago

@jeremywj @billdawgcbc on which device are you testing this ? What is the URL stream you're using ?

billdawgcbc commented 6 years ago

@sebsto I tested it on the echo dot. The url Is https://ffradio.streamon.fm But I also used another stream that I grabbed off he internet to test, assuming it was a problem with my stream. That didn’t work either.

sebsto commented 6 years ago

@billdawgcbc the URL is not a stream URL, but a web page URL (Content-Type: text/html). Try with an audio stream instead.

$ curl -v https://ffradio.streamon.fm/
*   Trying 184.164.141.210...
* TCP_NODELAY set
* Connected to ffradio.streamon.fm (184.164.141.210) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Server hello (2):
* TLSv1.0 (IN), TLS handshake, Certificate (11):
* TLSv1.0 (IN), TLS handshake, Server key exchange (12):
* TLSv1.0 (IN), TLS handshake, Server finished (14):
* TLSv1.0 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.0 (OUT), TLS change cipher, Client hello (1):
* TLSv1.0 (OUT), TLS handshake, Finished (20):
* TLSv1.0 (IN), TLS change cipher, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / DHE-RSA-AES256-SHA
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: OU=Domain Control Validated; CN=*.streamon.fm
*  start date: Jan 21 15:28:00 2017 GMT
*  expire date: Mar 22 23:30:42 2018 GMT
*  subjectAltName: host "ffradio.streamon.fm" matched cert's "*.streamon.fm"
*  issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
*  SSL certificate verify ok.
> GET / HTTP/1.1
> Host: ffradio.streamon.fm
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Vary: Accept-Encoding
< Content-Type: text/html; charset=utf-8
< ETag: "-954286143"
< Content-Length: 23570
< Accept-Ranges: bytes
< Date: Wed, 03 Jan 2018 07:13:05 GMT
< X-Varnish: 2308429146
< Age: 0
< Via: 1.1 varnish
< Connection: keep-alive
< Access-Control-Allow-Origin: *
<
<!DOCTYPE html>
billdawgcbc commented 6 years ago

@sebsto wow I’m an idiot. Overlooked something that simple. 5 minutes later and I got it running. Thanks for the help!

sebsto commented 6 years ago

@billdawgcbc Great - thank you for letting us know it is working now. Enjoy !

jeremywj commented 6 years ago

I'm still having this problem :(. Could it be that the URL for my stream uses a noncustom port/url?

https://scanwc.com:8001/stream

sebsto commented 6 years ago

Hello Jeremy,

Your device will connect from the wifi you have registered it to, to your stream. So port blocking depends on your network. Connecting a laptop on the same network are you able to connect to your stream ?

The certificate seems valid (beware, it will expire on Feb 2018) and the stream too.

I first thought it was an empty stream, because there is a lot of silence, but it looks like there are some intermittent radio talks.

I have mixed results with Alexa, sometime the stream is working, sometime the device sends a Playback Stopped request right after starting. I wonder if this can be caused by the silence. If you have the chance to start streaming on a talk, the skill streams without glitches. If you start during some long silence period, the Playback stopped event might be sent.

Try again, it worked for me, most of the time.

When not working, the sequence I observed in my logs are

"directives": [
      {
        "type": "AudioPlayer.Play",
        "playBehavior": "REPLACE_ALL",
        "audioItem": {
          "stream": {
            "url": "https://scanwc.com:8001/stream",
            "token": "https://scanwc.com:8001/stream",
            "expectedPreviousToken": null,
            "offsetInMilliseconds": 0
          }
        }
      }
    ]
"request": {
    "type": "AudioPlayer.PlaybackStarted",
    "requestId": "amzn1.echo-api.request.4a83a1da-dd76-4dd1-bab3-eced9980d239",
    "timestamp": "2018-01-14T17:10:46Z",
    "locale": "en-GB",
    "token": "https://scanwc.com:8001/stream",
    "offsetInMilliseconds": 0
  }
  "request": {
    "type": "AudioPlayer.PlaybackStopped",
    "requestId": "amzn1.echo-api.request.63b18102-fac6-4a5c-907d-4d004ae9db99",
    "timestamp": "2018-01-14T17:10:51Z",
    "locale": "en-GB",
    "token": "https://scanwc.com:8001/stream",
    "offsetInMilliseconds": 5590
  }
jeremywj commented 6 years ago

Thanks for the response. I actually got it to work last night. Turned out to be a cert issue. I am aware of the cert expiring in February. I use Lets Encrypt free certs which expire after 90 days.

simonravel commented 6 years ago

@sebsto Do you know if will be possible in the future to play long form audio on Sonos One?

sebsto commented 6 years ago

@simonravel both the Sonos and Alexa teams are on it, I can't comment on our timeline, but this is a high priority issue for us.

simonravel commented 6 years ago

@sebsto Thanks for your answer! It is good to know that they are working on it!