Register now for better personalized quote!

How to add song recognition to the Linux desktop

Jan, 09, 2024 Hi-network.com
three penguins in the water
elmvilla/Getty Images

I recently covered how to add song recognition to the MacOS menu bar (no Siri required), which helps keep you in the know as to whatever song is playing. This trick can come in very handy if you hear a tune and can't place the artist or title.

Now, guess what? You can do the same thing on Linux with SongRec. As you might expect, SongRec isn't quite as seamless as the MacOS option. However, given Apple bought Shazam and rolled it into the OS, this should come as no surprise. SongRec is a third-party piece of software -- and although it might not be as slick as the MacOS option, it still works very well.

Also: Thinking about switching to Linux? 9 things you need to know

Essentially, SongRec runs in the background, using your mic to recognize music that is playing. Once it recognizes a song, it will pop up a notification (that includes the artists and title). Click the notification and the SongRec window will open with the piece of music listed. You can then either click Search on YouTube to automatically bring up results for the song, or click Play a Shazam Lure (which, oddly enough, does nothing).

You can use SongRec to recognize music that's playing in the background or to recognize music from a local file. You can also disable notifications, which can be important. As long as the song continues playing (and SongRec is open), the program will keep popping up notifications, even after you've clicked it. That feature can be a bit annoying, especially if you're listening to a long track. 

Also: Want to save your aging computer? Try these 5 Linux distributions

SongRec also keeps a history of songs it's recognized. When you forget the song you heard earlier, you won't have to stress your memory. You can also add songs from your history to favorites and copy the artist, track name, or album to your OS clipboard.

Except in Arch Linux, you won't find SongRec in your distribution default repositories, so how do you install it? Let me show you.

How to install SongRec

What you'll need:The only things you'll need for this task is either a Ubuntu-based distribution, an Arch-based distribution, or a distribution that supports Flatpak. You'll also need a user with sudo privileges. 

Also: How to choose the right Linux desktop distribution for you

If you're using a desktop computer, you'll need to have an external microphone to use the app. With a laptop, as long as your mic works, you're good to go.

1. Install SongRec on an Ubuntu-based distribution

The first thing to do is open a terminal window. Once you've done that, you must run the following commands to install SongRec:

sudo apt-add-repository ppa:marin-m/songrecsudo apt-get install songrec -y

2. Install SongRec on an Arch-based distribution

To install SongRec on an Arch-based distribution, open a terminal window and issue the following command:

sudo pacman -S songrec

3. Install SongRec using Flatpak

If you have a distribution that supports Flatpak, you can install SongRec with the following commands:

sudo apt install flatpak -yflatpak remote-add https://flathub.org/repo/flathub.flatpakrepo --if-not-existsflatpak install --user flathub com.github.marinm.songrec -y

After the Flatpak installation is complete, log out, and then log back in to add SongRec to your desktop menu.

Using SongRec

SongRec is very simple to use. All you have to do is open the app while a song is playing and wait for it to recognize the tune. The tool should automatically have your microphone enabled, so it will work out of the box. Once SongRec recognizes the music that's playing, you can either right click the listing in Recognition History (and then paste the results in whatever music streaming service you use), or click Search on YouTube to see results for the piece.

The SongRec app in action.

SongRec immediately recognized Mahler's Symphony No. 2, as well as the musicians involved.

Jack Wallen/

One thing to keep in mind is that you'll need to manually close the SongRec app or the program will continue listening for music. There is also no system tray option, so the tool runs as a standard app. Once closed, the listening system shuts down and you're good to do. The next time you hear a tune you don't recognize, open SongRec and the app will help you out.

Congratulations, you've just added music recognition to your Linux desktop.

tag-icon Hot Tags : Tech Services & Software Operating Systems

Copyright © 2014-2024 Hi-Network.com | HAILIAN TECHNOLOGY CO., LIMITED | All Rights Reserved.