Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Internet Radio Player

Internet Radio Player with an web interface.

Build Status


mpd and mpc - music player daemon

sudo apt-get update
sudo apt-get install mpd mpc

flask - lightweight web application framework

sudo apt-get install python-pip
pip install -U Flask

oyaml - YAML parser which preserves dict ordering

pip install oyaml


python3 [-h] [--host HOST] [--port PORT]
               [--bluetooth-speaker-device BLUETOOTH_SPEAKER_DEVICE]
               [--show-volume-controls {yes,no}]

Internet radio with Web interface for Linux or Raspbian.

optional arguments:
  -h, --help            show this help message and exit
  --host HOST           Web ui host
  --port PORT           Web ui port
  --bluetooth-speaker-device BLUETOOTH_SPEAKER_DEVICE
                        Bluetooth device identifier (taken from bluetoothctl)
  --show-volume-controls {yes,no}
                        Show volume controls, choices: yes / no, default: yes

Control Panel

With default values, the control panel works on address:

If you have specified custom host and/or port, create the url by schema:


Station list

You can manage the station list in the stations.yml file.

Run tests


Installation on Raspberry Pi with Raspbian OS.

sudo apt-get update
sudo apt-get install git python3 mpd mpc python-pip
sudo pip3 install -U Flask oyaml
git clone radio

Create startup script, for example in path /home/pi/, with contents:

cd /home/pi/radio

You can set custom host and port in the command above.

Test the web ui in your computer/phone/tablet browser, in my network the Raspberry Pi has the address:, so I open the following url in my browser:

Connect headphones or speakers to the Raspberry Pi and click play in Web UI.


Add startup script to cron:

crontab -e

and enter the following line:

@reboot sh /home/pi/

Reboot Rasperry Pi to check if the cron entry works:

sudo reboot

Bluetooth speaker

In you want to connect a Bluetooth speaker to Raspberry Pi you have to install Bluez-alsa. I managed to do it using the instruction on the page how-to-stream-sound-to-a-bluetooth-device-from-a-raspberry-pi-zero

Here is my audio output config in /etc/mpd.conf that works with Creative Muvo 2c bluetooth speaker:

audio_output {
       type            "alsa"
       name            "BluetoothSpeaker"
       device          "bluealsa:DEV=XX:XX:XX:XX:XX:XX,PROFILE=a2dp" # replace XX:XX:XX:XX:XX:XX with bluetooth device id

Example ecosystem

Example ecosystem for Raspberry Radio


[PL] Artykuł na blogu: Python – odtwarzacz radia internetowego – Linux i Raspberry Pi