Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate streaming audio directly to Echo devices #25

Open
declension opened this issue Nov 14, 2017 · 7 comments
Open

Investigate streaming audio directly to Echo devices #25

declension opened this issue Nov 14, 2017 · 7 comments

Comments

@declension
Copy link
Owner

It's doable, definitely. Doesn't have much use for me (especially as I have Echo Dots) but upvote this issue if you're interested in it.

Some (commercial) systems e.g. My Media can do this as I found out recently.

@declension declension changed the title Investigate playing actual audio on Echo devices Investigate streaming audio directly to Echo devices Nov 14, 2017
@ggalt
Copy link

ggalt commented Dec 10, 2017

This would be an interesting addition. I believe you can get a stream to any MP3 compatible device via the address of http://[serverIPAddress]:9000/stream.mp3, and it then appears as a device (under it's IP) in the server interface. I don't know how one gets the Echo to make the HTTP request, but it shouldn't be too hard to figure out.

@declension
Copy link
Owner Author

Yes the Alexa side I mostly figured out a while ago (though it's probably changed with new APIs).

The problem is mainly networking, and SSL...

@ggalt
Copy link

ggalt commented Dec 17, 2017

OK, do tell! I'd love to see what you have put together. On the issue of networking/SSL, are you saying that the stream has to be pulled through from an external domain and not from the internal network (even if that just means that your internal squeezebox server has to be able to go out through the router/firewall)?

@declension
Copy link
Owner Author

On the issue of networking/SSL, are you saying that the stream has to be pulled through from an external domain and not from the internal network (even if that just means that your internal squeezebox server has to be able to go out through the router/firewall)?

Sorry about the delay. I tried this again recently, and it was close but yeah. It really wants to come from a real domain with real SSL (I found a workaround to this part though). No way I wanted to open the stream out to the internet, and streams on all internal IP addresses seemed to fail. My last plan was some "clever" public DNS (as many router manufacturers now do), but I think I just gave up at that point.

@PaulWebster
Copy link

FYI ... I have it working
https://forums.slimdevices.com/showthread.php?110155-Using-Amazon-Alexa-device-as-LMS-player

Key to it is have your HTTPS server return a playlist in response to the Skill receiving an Open/Play.
I have my dev skill returning a play response with target URL something like:
https://myserver/simpleplayer.php

In PHP - something like this works - but see my post of Squeezebox forum for ideas about how to integrate it.

` header('Content-Type: audio/x-scpls');
header("Content-Disposition: inline; filename="playlist.pls"");

$c = "[playlist]\n";
$c .= "Numberofentries=1\n";
$c .= "File1=$playlist\n";
$c .= "Title1=Alexa\n";
$c .= "Length1=-1\n";
$c .= "Version=2\n";

echo $c;

`

where $playlist would be something like http://192.168.x.y:9000/stream.mp3?player=Echo
Clearly this would be different for each installation - and potentially different for each player on same LAN (although - I think leaving out the "player" part will still work but might be harder to work out which is which in LMS interface.

@declension
Copy link
Owner Author

declension commented Feb 13, 2019

Thanks @PaulWebster that's helpful.

This is actually very similar to what I'd done. Since then, I've realised the networking problem was actually a "feature" of the then network - all echos were on a separate wifi network with client isolation (paranoia...), so they would never be able to connect to these local IPs, and I believe this what was stopping it from working.

Manual tests (with mplayer, vlc, and Firefox) still indicated that the stream.mp3 was quite flakey but worth another try when I get some time..

@declension
Copy link
Owner Author

Just caught up with that forum discussion (thanks @PaulWebster and others) around the difficulties of getting this right (mainly, it seems, around buffering and lack of metadata over the wire).

Note also that another implementation dropped streaming "as it was flaky, cumbersome and problematic".

None of these means it's not doable, but it does confirm my (much) earlier testing - doable, but no hope of proper synchronisation or even perhaps reliability still.

So not sure what the appetite is out there for this? (not really a priority for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants