bencevans / node-sonos

🔈 Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
700 stars 146 forks source link

Won't play MP3 from my own computer? #2

Closed julien51 closed 11 years ago

julien51 commented 11 years ago

Hello,

I tried the queuenext.js example. It works great. So I tried to do the same thing from my local machine, using its localnetwork IP which should be visible from the SONOS, but for some reason my HTTP server never gets the request from the sonos :(

I have posted the sample code there: https://gist.github.com/julien51/108f51e95a1e220e23c5

Any idea?

julien51 commented 11 years ago

So, actually, it looks like Sonos is really picky and wants the url to end with .mp3.

It won't complain anymore, but still won't play the music :(

julien51 commented 11 years ago

I was eventually able to get this to work, the problems were due to a missing http header (Content-Length)

bencevans commented 11 years ago

@julien51 Glad you found the solution and thanks for reporting, very helpful or others :thumbsup:

julien51 commented 11 years ago

Yay! So, actually, I am still investigating and trying how to play a "stream", as opposed to a single file. It looks like the only 'streaming' protocol supported by the SONOS is Icecast. I'll try that later!

It won't work with a regular mp3 because it seems to be using the Content-Length header, and well, Content-Length is unknown for a real stream :)

bencevans commented 11 years ago

@julien51 sweet, I'd recommend some of @TooTallNate's work with NodeFloyd (node.js Icecast-compatible server) and possibly node-icecast (Icecast meta parser/injector).

Please keep us posted :smile:

julien51 commented 11 years ago

Dammit. I'm still unable to send anything that would be a stream to my sonos using the sonos.queueNext API. I keep getting UPnPError. huh.

julien51 commented 11 years ago

Ok, so the UPnPError is still due to a format problem. Sonos will play icecast if you replace the http with x-rincon-mp3radio. Pfiou. Next, actually get the writer for node-icecast to work!

bencevans commented 11 years ago

replace the http with x-rincon-mp3radio

@julien51 by this do you mean change the content-type header on the server?

julien51 commented 11 years ago

Nope, the url scheme this time.

On Sun, Mar 17, 2013 at 9:21 AM, Ben Evans notifications@github.com wrote:

replace the http with x-rincon-mp3radio

@julien51 https://github.com/julien51 by this do you mean change the content-type header on the server?

— Reply to this email directly or view it on GitHubhttps://github.com/bencevans/node-sonos/issues/2#issuecomment-15019175 .