There are so many music players that support audio streaming, but what if you prefer to listen to your favorite radio stations without leaving the command line? There are actually quite a few command line music players that let you listen to radio stations directly from the terminal. These are fairly simple and practical utilities that save you from having to open a browser.
In this article, we’ll talk about three different utilities that let you listen to online radio stations directly from the Linux command line. We will explain how to install and use each of these utilities and how to remove them from your system, if necessary.
We ran the commands and procedures mentioned in this article on a Debian 10 system.
Method 1: Using Pyradio
Pyradio is a free, open-source command-line radio player. This allows you to listen to your favorite radio stations directly from your terminal. It is based on Python and uses mplayer to play multimedia. It is available as a simple package for Linux users, which makes it easy to install it either through the terminal or through the software center.
We will install it using the “Terminal” application. So, launch the Terminal application on your system by going to activity tab in the upper left corner of the Debian desktop. Then in the search bar enter Terminal, When the terminal icon appears, click on it to launch it.
Switch to the superuser account by executing the following command in the terminal:
When you ask for a password, enter your password and press Enter.
Then enter the following command to update the list of available packages:
$ apt-get update
Since Snap is shipped by default in recent versions of Linux, we don’t need to install it. However, if you are using an older version of the OS, you can use the following command to install it:
$ apt-get install snapd
Now we need to use the snap-in to install Pyradio on our system. To do this, run the following command in Terminal:
$ snap install pyradio
Wait for a while until the installation is complete. After the installation is complete, you will receive output similar to the above, as well as the version of Pyradio installed on your system.
In case you want to remove Pyradio installed using this method, run the following command in Terminal:
$ snap remove pyradio
After successfully installing Pyradio, it’s time to launch it and start playing your favorite radio stations. Running this radio player is quite simple. Run the following command in Terminal to start the player, and it will start playing a random station from the list:
$ pyradio --play
You can use the following keyboard shortcuts to configure the list of stations and play any station:
|Up / J / PgUp / down / to / PgDown||Change station selection|
|To come in||Play selected station|
|– / +||Change volume|
|R||Select and play any station|
|Space||Stop / start playback of the selected station|
|from||Open configuration window|
|t t||Download theme / switch theme transparency|
|Del x||Delete selected station|
|Esc / d||Exit the player|
Method 2: Via Mplayer
Mplayer is a movie player for Linux that can play various audio and video formats. It is supported on various operating systems such as Windows, Mac OS X, and Linux. It can play MPEG / VOB, AVI, ASF / WMA / WMV, RM, QT / MOV / MP4, Ogg / OGM, MKV, VIVO, FLI, NuppelVideo, yuv4mpeg, FILM and RoQ files, supported by many native and binary codecs. It also supports digital video broadcasting (DVB).
But here we will use it to play radio stations from the Terminal application. It is available through the official Debian repositories and can be easily installed via the command line using the apt-get command. To do this, run the following command in a command line terminal:
$ apt-get install mplayer
During installation, the Y / n option will be provided to continue the installation. Type Y, then press Enter. Wait for a while until the software installation is complete.
If you want to uninstall mplayer installed using this method, you can use the following command in Terminal:
$ apt-get remove mplayer
To play on radio stations, simply type MPlayer followed by the URL of the radio as follows:
$ mplayer [station-URL]
Method 3: via Mpg123
Mpg123 is a free, open source command line player. It supports MPEG audio formats, including MP3. We can also use it to play radio stations by providing URLs.
The mpg123 audio player is available through the official Debian repositories and can simply be installed through the Terminal using the apt-get command. You can do this by running the following command in Terminal:
$ apt-get install mpg123
During installation, the system will give you the option of Y / n to continue the installation. Type Y, then press Enter. Then wait a while until the installation is complete on your system.
In case you want to remove mpg123 installed using this method, you can use the following command in Terminal:
$ sudo apt-get remove mpg123
To play the radio, simply enter mpg123 and then the URL of the radio, as shown below:
$ mpg123 [station-URL]
Thus, these were three ways in which you can listen to your favorite radio stations directly from the terminal without having to open a browser. Enjoy the music!
Three Internet Clients for Debian 10 Terminal