Git Product home page Git Product logo

alexapcstreaming's Introduction

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

alexapcstreaming's People

Contributors

1panic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

dirrot tandrio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.