Radio is the oldest form of electronic mass communication and even in the third decade of the 21st century it is still how people consume news, find new music and pass the time when stuck in traffic on the way to work.
The Internet allows you to listen to radio stations from all over the world, exposing you to music, culture, news and events that you would otherwise never have discovered. You can listen to Internet radio without ever leaving your Linux terminal. Here’s how.
What is Internet Radio?
Until the beginning of the 20th century, entertainment was limited to performance venues. You can go to the theater or a dance hall to hear live music, or sing around the piano in a pub. From time to time we were visited by musicians.
For news, you can read the newspaper, and depending on where you are in the world, that news can take weeks or months to arrive. Life was dark, people were uninformed and music was limited.
Radio changed everything. It was no longer necessary to wait for passing travelers to tell stories of what was happening in distant lands. News, music, and entertainment were broadcast over the airwaves to entire nations, and smaller stations served individual cities. With the right equipment, at the right time of day, you can listen to radio stations from across oceans.
With the advent of the Internet, streaming radio has emerged. It was no longer necessary to install arrays of teleloop antennas to listen to BBC Radio 4 at night from the continental United States. All you needed was a browser or streaming client, and a good internet connection to listen to the local news and music scene from anywhere in the world.
Usually, to listen to Internet radio, you have to visit a number of websites that offer to tune in to live broadcasts. If you live in an area that is subject to data protection laws, you will see pop-ups asking for your consent to track you, display ads and sell your data. If you don’t… it still happens.
Music apps like Spotify have the same problem and lock you in a walled garden, exposing you to music that the algorithm determines is right for you, rather than real exposure to the outside world.
Why listen to Internet radio from the terminal?
Although there are dozens of standalone Internet radio clients for the Linux desktop, using one means you have to install and manage another application. That’s one memory you can’t afford to lose, and they tend to force you to use the mouse as well.
PyRadio is a complete Internet radio client that you can run directly from your terminal. Completely keyboard driven, it has a low storage capacity and small memory footprint, as well as a good Terminal User Interface (TUI).
The easiest way to install PyRadio is to use your package manager, however, the application is not available in all standard repositories. Although, as its name suggests, a Python application, the version of PyRadio available directly through PIP has not been updated since 2013.
If you cannot get the PyRadio application through the package manager, you will need to use an installation script prepared by the developer. But first, you need to install Python. Once Python is installed on your system, use it to install other dependencies:
python3 -m pip install
Use wget to download the installation script:
…and install using Python:
If all goes well, you should see a success message like the one above.
You can now launch PyRadio from any terminal with:
Use PyRadio to listen to radio stations around the world!
Run PyRadio without any arguments and you will see the user interface with a playlist of stations selected by the developer. There’s something for almost everyone, with genres like hip-hop, indie pop, jazz, gothic rock and even Slay FM’s Commodore 64 remixes.
Navigation is simple: use the arrow keys to move from one station to another and press the key. Sign in to choose. To stop playback, press ROOM. The title and artist of the current track are displayed at the bottom of the interface.
You can navigate up, down or in the middle of the playlist using the key. H, LWhere M– which is easy to remember if you think “high, low, medium”.
PyRadio has five built-in themes and you can access them by typing ” you” on your keyboard. For a more complete list of key combinations, press » « .?“.
Being able to listen to the developer’s pre-built station list is great, but you may not agree with its selections, or you may have already decided which stations you want to listen to.
PyRadio loads its playlist from a CSV (Comma Separated Value) file located in the directory ~/.config/pyradio/stations.csv.
To add, remove or edit preset stations, use nano to open the playlists file:
You will see that each line contains two parts. The first is the station name and the second part after the comma is the stream URL. You can remove lines you don’t want, add new ones, rename the station to something memorable, or change the URL of the stream if it changes.
It goes without saying that your custom station names should not contain commas.
Save and exit nano me CTRL+O then CTRL+X.
If you listen to stations from all over the world, it can be useful to create several playlists. These can be related to country of origin, music genre, time zone or news stations. Depends from you.
Create new stations using nano to create and edit new CSV files in the user directory. ~/.config/pyrradio/ directory. Remember to name your playlists with a ” .csv ” expansion.
To start PyRadio with a specific playlist, use the command -s with the name of your playlist. For example:
pyradio -s ~/.config/pyradio/'Russian Numbers Stations.csv'
Although you can put your playlist anywhere, if you load it this way, PyRadio will warn you that it’s a foreign playlist and ask you to copy it to the config directory.
To load a playlist from PyRadio, press ” oh“.
Internet radio is the best radio
Listening to internet radio on your device is the best way to discover this medium. There’s no need to fiddle with a dial or wait for the tubes to heat up, and it’s easy to search and sort through stations to create your own playlist. There’s also an unspoken sense of freshness that comes from using clutter-free terminal apps instead of cumbersome GUIs or browsers.
The only way to make PyRadio even more awesome is to listen to its output with good headphones.