Skip to content

1Panic/AlexaPcStreaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PC to Amazon Alexa streaming

Send your PC Audio to Amazon Alexa with Multiroom support!

How it works?

Its easy!

  1. redirect a TuneIn stream to your local PC with a Modded StreamWhatYouHear (https://github.com/StreamWhatYouHear/SWYH) instance.
  2. Call Alexa to open that stream. Enjoy!

Requirements

  • Router that supports LAN DNS Resolution / Conditional DNS Forwarding (for example DrayTek Vigor Series, a Linux router, etc.)
  • PC that is running a Modded version of StreamWhatYouHear (https://github.com/1Panic/SWYH/releases/)
  • TuneIn Domain that you can redirect to your PC (e.g. streams.harmonyfm.de)
  • Amazon Echo device

(Optional) If You like to switch the PC that streams to Alexa, you can add a http Server in your LAN that redirect any requests to your active pc:

  • HTTP Webserver in your LAN (i use my Synology Nas)
  • A small php script to redirect the http request

Let's get it started

1. Setup SWYH

  • Install StreamWhatYouHear/SWYH on your PC (http://www.streamwhatyouhear.com/download/) and replace it with the Modded version (https://github.com/1Panic/SWYH/releases/)

  • Set the Listning Port from SWYH to 80, optional activate run at logon, restart SWYH! SWYH Config

  • Pay audio(Spotify, Twitch, Youtube, Winamp ...) with high volume (SWYH capture your default output device)

  • Open your stream on a other device (PC, Handy, Tablet, etc.) http://PC-IP/teststream.mp3 (e.g. http://192.168.0.50/stream.mp3) (The modded Version of SWYH accepts any url, so if you redirect a domain to you PC, Alexa always get a working stream regardless of the original destination)

  • If you hear your audio, your done on the PC side.

2. Find a Domain

  • You need to capture the communication between your Alexa and TuneIn to get a DNS request that you can redirect.
  • I use WireShark (https://www.wireshark.org/#download) to capture the trafic from my Linux router.
  • Get the MAC adress from your Alexa (you can find it in the Info Tab on your Alexa APP at your Device list) so its easier to filter the traffic (Wireshark filter: eth.addr == xx:xx:xx:xx:xx:xx)
  • Say to your Alexa it shouldt play a TuneIn stream (or via Alexa APP) that you normaly not use and search for the request in Wireshark. Tipp: Look for a radio station with its own domain that doesn't change often. Bigger stations are more stable.
  • Search for an HTTP request to opml.radiotime.com like:
opml.radiotime.com/Tune.ashx?id=e9311784&sid=s846&formats=aac,mp3,hls&partnerId=!EALLOjB&serial=G2PK3SH77AXEXQFTOW7YA

3. Redirect DNS

  • On your router add a custom DNS resolution to your PC that runs SWYH. Router Config

  • Check your router manual if you don't know how.

4. Alexa play HarmonyFM

  • Don't forget to restart (Power cycle) your Alexa to clear the DNS cache!
  • Say "Alexa play HarmonyFM everywhere" Enjoy!

Optional add an HTTP Server to easily switch between your streaming PC's

    location / {
      rewrite ^([^.]*[^/])$ $1/ permanent;
      try_files $uri $uri/ /index.php =404;
      include fastcgi_params;
      fastcgi_pass unix:/run/php-fpm/php-c955c07d-aa67-4013-bcda-4189fb9a1f34.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_intercept_errors on;
   }

If you like it, buy me a coffee

  • PayPal Donate
  • bitcoin:bc1q70dnwxa7yh7wmq83wasqn2utpkxfxhd6znpxgc?message=coffee

BTC

Credits

Big THX to Sébastien Warin (https://github.com/sebastienwarin) for StreamWhatYouHear/SWYH https://github.com/StreamWhatYouHear/SWYH

About

Send your PC Audio to Alexa with Multiroom support!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages