Skip to content

Python script to stream any file at any URL to your Roon server.

License

Notifications You must be signed in to change notification settings

lfontanel/Roon-FLAC-restreamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Roon-FLAC-restreamer

DISCLAIMER

This is a proof of concept, mostly because I'm a podcast junkie and that is the one feature I miss in Roon compared to my old Daphile/Squeezebox setup.

It assumes you know what you're doing.
It comes "as-is", i.e. I might answer questions on the Roon forum but assume it comes with no support.
My environment is a Roon Core running on Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-46-generic x86_64). I have no idea if it works on any other platform.

If you're afraid to break your Roon server, do not install it.

I did my best to document dependencies, commands, etc. mostly because it was such a pain to setup. If you find a typo, have an idea on how to make it better, please create a Pull Request.

A- Software pre-requisites

I installed everything on my Roon Core, but it can be installed on a different host. If you install it on a different host, replace 'localhost' with your host name/ip address in your FLACReStreamer Roon radio station URL in step B-2 and edit the .py and .liq files accordingly.

# I'm using Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-46-generic x86_64)
pip3 install /Users/.../Downloads/six-1.12.0.tar.gz # had to manually download it
pip3 install /Users/.../Downloads/websocket_client-0.54.0.tar.gz # had to manually download it
pip3 install roonapi
pip3 install requests
sudo apt install icecast2 # use 'roon' as default password or use your own but edit the .liq files
sudo apt install liquidsoap

B- Roon setup

1. At the command-line:

chmod +x setup_token.py
chmod +x restream.py
chmod +x setup.liq
chmod +x play.liq
./setup.liq

You should see a bunch of output. Using VLC, you can verify that http://localhost:8000/stream.flac is producing 16/44.1 FLAC-encoded music.

2. In Roon:

create an Internet Radio station with URL http://localhost:8000/stream.flac named FLACReStreamer.

3. At the command-line:

Kill the setup.liq session (ctrl-D).

Setup the ROON API wrapper

4. At the command-line:

laurent@nexus7:~$ ./setup_token.py
2019-03-24 15:24:25,064 INFO   roonapi -- Connecting to Roon server x.x.x.x:9100
2019-03-24 15:24:25,071 INFO   roonapi -- Connection with roon websockets (re)created.
2019-03-24 15:24:25,072 INFO   roonapi -- The application should be approved within Roon's settings.

5. In Roon again:

Settings > Extensions > Python API for Roon > Enable The console should show:

2019-03-24 15:24:38,175 INFO   roonapi -- Registered to Roon server xxx

4. At the command-line:

The script should complete and print the API token.

Now we can finally re-stream

./restream.py https://sample-videos.com/audio/mp3/crowd-cheering.mp3

You're welcome!

About

Python script to stream any file at any URL to your Roon server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages