Shell

Three ways to Listen to Radio via Ubuntu Terminal

Three ways to Listen to Radio via Ubuntu Terminal

We, the Terminal-savvy people, do not like to leave the comfort of the command line and go somewhere else to do our activities. We always find ways to do all our stuff right inside the Terminal. Why should listening to radio be any different? In this article, we will describe three tools through which you can listen to online radio right from your Linux Terminal. We will explain how you can install each of these tools, use them, and remove them from your system if need be.

We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS system.

Method 1: Using Pyradio

Pyradio is a free and open-source command line tool that lets you play your favorite radio stations through the Terminal. It is based on Python and now available on Snap from where you can install it easily.

Open your Ubuntu Terminal either through the Application Launcher search or by using the Ctrl+Alt+T shortcut. Enter the following command in order to refresh the list of available packages:

$ sudo apt-get update

Since the Snap daemon comes by default in the latest versions of Ubuntu, we do not need to install it. If you are using an older version, you can use the following command to install the daemon:

$ sudo apt-get install snapd

Now type in the following command in order to install Pyradio to your Ubuntu:

$ sudo snap install pyradio

The process might take some time depending on your Internet speed, as it is a slightly larger package. The similar output as I got will indicate the completion of the installation and will also print the Pyradio version installed on your system.

If you ever want to remove Pyradio installed through this method, you can use the following command in the Terminal:

$ sudo snap remove pyradio

How to use Pyradio

So how do we use this tool? Running this radio player is pretty simple. Use this command to start the player and it will start playing a random station from the list:

$ pyradio --play

In order to customize the station list and to play selected stations, you can use the following commands while the radio player is still running:

ControlPurpose
Up/j/PgUp/Down/k/pgDownChange station selection
EnterPlay selected station
-/+Change volume
M vMute
rSelect and Play a random station
SpaceStop/start playing selected station
cOpen configuration window
t TLoad theme/ toggle theme transparency
Del, xDelete selected station
Esc/qQuit the player

Method 2: Through the Mplayer

Mplayer is a movie player for Linux (runs on many other platforms and CPU architectures, see the documentation). It plays most 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.

What we are interested in here is the capability of the player to play radio stations by providing the online radio stations URL, right in the Terminal.

The mplayer utility is easily available through the official Ubuntu repositories and can easily be

installed through the command line using the apt-get command. You can do so by running the following command as sudo:

$ sudo apt-get install mplayer

The system might ask you the password for sudo and also provide you with a Y/n option to continue the installation. Enter Y and then hit enter; the software will be installed on your system. The process may, however, take some time depending on your Internet speed.

If you ever want to remove the mplayer installed through this method, you can use the following command in the Terminal:

$ sudo apt-get remove mplayer

In order to play a radio station, use the mplayer command as follows:

$ mplayer [station-URL]

Method 3: Using Mpg123

mpg123 is a free and open-source audio player. It supports MPEG audio formats, including MP3. It is a console application, meaning that it has no graphical user interface. Is would help us in the sense that we can play radio stations on it by providing the URL in the mpg123 command.

The mpg123 utility is easily available through the official Ubuntu repositories and can easily be

installed through the command line using the apt-get command. You can do so by running the following command as sudo:

$ sudo apt-get install mpg123

The system might ask you the password for sudo and also provide you with a Y/n option to continue the installation. Enter Y and then hit enter; the software will be installed on your system. The process may, however, take some time depending on your Internet speed.

If you ever 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, use the mplayer command as follows:

$ mpg123 [station-URL]

So these were three ways for you to listen to online radio not just through your Terminal application, but also inside it. Enjoy the music!

Remap your mouse buttons differently for different software with X-Mouse Button Control
Maybe you need a tool that could make your mouse's control change with every application that you use. If this is the case, you can try out an applica...
Microsoft Sculpt Touch Wireless Mouse Review
I recently read about the Microsoft Sculpt Touch wireless mouse and decided to buy it. After using it for a while, I decided to share my experience wi...
AppyMouse On-screen Trackpad and Mouse Pointer for Windows Tablets
Tablet users often miss the mouse pointer, especially when they are habitual to using the laptops. The touchscreen Smartphones and tablets come with m...