Playing Audio Files

Audio playback under Ubuntu is normally handled by the Banshee Media Player. This is a feature-packed piece of software that can play back all kinds of audio files, including podcasts, Internet radio, and even CDs. In addition to audio, Banshee also handles digital video. There are some other programs as well that allow you to play back digital audio. One example is Totem, the Ubuntu movie player, which can also play back digital audio files. And there’ s also the Rhythmbox Music Player, which was used as the default player for digital audio in previous versions of Ubuntu.

Like many modern music players, Banshee can also manage your music collection, arranging it into a library so you can locate songs easily and create playlists. This makes it a better choice for playback if you have many digital audio files, although Totem is good for quick playback of individual files, such as auditioning those you’ve just downloaded.

Out of the box, Ubuntu supports playback of Ogg Vorbis and FLAC across all its audio playback applications. These are two open audio file formats, which you learn more about in the “Choosing a Format”.

To play back other music file formats, such as the ubiquitous MP3 format, additional software known as codecs must be installed. A codec handles the decoding of multimedia files, both audio and video. The word is a shortened version of coder-decoder. For any digital multimedia file type you want to play on your computer, you need an appropriate codec. In addition, if you want to create your own multimedia files—for example, to create MP3s from CD audio tracks—you might need to download an additional codec that allows the encoding of files.

Installation of codec software is largely automated in Ubuntu. However, the issue of patenting continues to have an impact on the distribution of codecs. Several audio codecs available for Linux, contained in various gstreamer-plugins software packages, are not licensed with the patent holders. This is of little issue to you as an end user. It’s a practical concern only for the distributors of the codecs, because the laws of some countries state that it’s their duty to pay patent licensing fees. It’s just something you should be aware of. Fully licensed codecs are available for many formats via the commercial Fluendo plug-in suite, which is available from the Canonical store.

Installing Codecs in a Single Package

There is an extremely simple way to install support for all of the common multimedia codecs that aren’t distributed by default in Ubuntu. It’s a package called Ubuntu Restricted Extras. With a single click, this package will bring in support for MP3 and the common proprietary video formats, including the Flash plug-in in Firefox, and as a bonus it will install the Microsoft TrueType core fonts (such as Times New Roman and Arial) and OpenJDK, a free/open source version of Java. (The proprietary Sun JDK/JRE is available as an alternative from the Canonical Partner Repository). To get this very convenient bundle of software onto your system, enter the Ubuntu Software Center (you’ll find it by selecting the Applications option from the Panel), and type restricted extras in the search bar. Select Ubuntu Restricted Extras from the results list, click the Install button, and enter your password when prompted.

Screenshot from 2020-06-11 11-54-18

Figure. Installing the Ubuntu Restricted Extras package in the Ubuntu Software Centre is the easiest
way to get support for the most commonly used digital audio and video formats.

Once the Ubuntu Restricted Extras is installed, all of Ubuntu’s playback software will automatically support MP3 files, including Totem, Banshee, and any other playback software you install that is designed for the GNOME Desktop.

This is made possible because, behind the scenes, all of Ubuntu’s audio and video playback is underpinned by the GStreamer multimedia framework. Once the codec-supporting plug-ins have been installed into GStreamer, as a user you won’t come into direct contact with GStreamer, but the benefit of having this integrated system in the background is that you install plug-ins only once for the entire system.