There are so many music players that support audio streaming, but what if you’d rather listen to your favorite radio stations without leaving the comfort of the command line? There are actually quite a few command-line music players that let you listen to radio stations directly in the terminal. These are quite simple and handy programs that save you from opening a browser.
In this article, we will introduce you to three different media players that allow you to listen to online radio stations directly from the Linux command line. We’ll explain how to install and use each of these utilities, and how to remove them from your system if necessary.
We have run the commands and procedures mentioned in this article on a Debian 11 system.
Pyradio is a free and open-source command-line-based radio player. It allows you to listen to your favorite radio stations directly from your terminal. It is based on Python and uses MPlayer for media playback. For Linux users, it is available as a snap package that can be installed either from the terminal or from the Software Center.
We will install it via the terminal application. So, launch the terminal application in your system by going to the Activities tab at the top left of your Debian desktop. Then type terminal in the search bar. When the terminal icon appears, click on it to launch it.
Switch to the superuser account by running the following command in Terminal:
When ask for the password, type your password and hit Enter.
Then enter the following command in order to refresh the list of available packages:
$ apt-get update
As the Snap comes by default in the latest versions of Linux OS, so we do not 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 will have to use the snap to install Pyradio on our system. To do so, run the following command in Terminal:
$ snap install pyradio
Wait for a while until the installation is completed. Once done with the installation, you will get the output similar to above along with the Pyradio version installed on your system.
In case, you want to remove Pyradio installed via this method, run the following command in the Terminal:
$ snap remove pyradio
After the successful installation of Pyradio, it’s time to launch it and start playing your favorite radio stations. Running this radio player is pretty straightforward. 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 in order to customize the station list and to play any station:
|Up/j/PgUp/Down/k/pgDown||Change station selection|
|Enter||Play selected station|
|r||Select and Play a random station|
|Space||Stop/start playing selected station|
|c||Open configuration window|
|t T||Load theme/ toggle theme transparency|
|Del, x||Delete selected station|
|Esc/q||Quit the player|
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).
However, here we will use it to play radio stations through the terminal application. It is available in the official Debian repositories and can be easily installed from the command line using the apt-get command. To do so, run the following command in the command line of your terminal:
$ apt-get install mplayer
During the installation, it will provide with Y/n option to continue the installation. Enter Y and then hit enter. Wait for a while until the installation of software is completed.
In case you want to remove the mplayer installed through this method, you can use the following command in the Terminal:
$ apt-get remove mplayer
In order to play a radio station, simply type mplayer followed by the radio station URL as follows:
$ mplayer [station-URL]
Mpg123 is a free and open source command line audio player. It supports MPEG audio formats, including MP3. We can also use it to play radio stations by specifying the URLs.
The mpg123 audio player is available in the official Debian repositories and can be easily installed from the terminal using the apt-get command. To do this, you can run the following command in the terminal:
$ apt-get install mpg123
During the installation, the system will provide you with a Y/n option to continue the installation. Enter Y and then hit enter. Then wait for a while until the installation is completed on your system.
In case, you want to remove mpg123 installed through this method, you can use the following command in the Terminal:
$ sudo apt-get remove mpg123
In order to play a radio station, simply type mpg123 followed by the radio station URL as follows:
$ mpg123 [station-URL]
So these were the three ways using which you can listen to your favorite radio stations right from the Terminal without the need of opening any browser. Enjoy the music!