
Configure EMMS: Emacs MultiMedia System on GNU/Linux

Peter Prevos |
1207 words | 6 minutes
Share this content
Music is a great tool to boost your productivity. Playing the transcendental music of J.S. Bach or Sepultura's screeching heavy metal soothes the soul while writing. Scientists have studied the psychological effect of background music and found that it can improve episodic memory, intelligence, and verbal and visual processing speeds.
Emacs might be known as a text editor, but you can also play background music while you write, or listen to podcasts and videos in your information ingestion process. Emacs has several packages, such as Bongo and EMMS, to help you access your collection of sound files. You might already have a great music player on your computer, but not having to switch applications to play music helps to retain your focus.
EMMS, the Emacs Multimedia System, is a comprehensive music and video player for Emacs. It contains an intuitive browser that can show album covers and metadata. This article explains how to configure EMMS to convert your Emacs system into your personal jukebox.
This article is part of Emacs Writing Studio, a book that explains how to use Emacs to undertake research and write and publish articles, books, and websites. Emacs Writing Studio is available as an e-book from your favourite retailer.
Emacs Writing Studio
A comprehensive guide for writers seeking to streamline their workflow using Emacs. The book covers everything from organising ideas and writing distraction-free to publishing in multiple formats. It’s perfect for both beginners and experienced Emacs users, offering practical tips and a tailored configuration to enhance your writing process.
The source files of the book and EWS configuration are also freely available on GitHub.
Basic Installation
EMMS does not work out of the box when you install it via GNU ELPA. You will need some configuration and a music player. The minimum configuration for your init file consists of these lines:
;; Emacs Multimedia System
(use-package emms
:config
(require 'emms-setup)
(require 'emms-mpris)
(emms-all)
(emms-default-players)
(emms-mpris-enable)
:custom
(emms-browser-covers #'emms-browser-cache-thumbnail-async)
:bind
(("C-c w m b" . emms-browser)
("C-c w m e" . emms)
("C-c w m p" . emms-play-playlist )
("<XF86AudioPrev>" . emms-previous)
("<XF86AudioNext>" . emms-next)
("<XF86AudioPlay>" . emms-pause)))
This configuration initiates EMMS with all its functionality and provides access to default music players. This setup is, however, not enough to fully enjoy your music. EMMS needs access to a music player to create sound and access to software to convert cover images to thumbnails.
To play sounds with Emacs, you must install one of the compatible sound players (ogg123, mpg321, mplayer, mpv or VLC). EMMS uses the convert
program of the ImageMagick, a software suite to edit and manipulate digital images. When you run the complete Emacs Writing Studio configuration, the system will check whether one of the players and ImageMagick are available.
The last step to start playing music is to cache the music files. Evaluate the emms-add-directory-tree
command to scan your collection. EMMS creates a cache in your Emacs configuration directory.
EMMS can read metadata in music files for Ogg Vorbis, Opus, FLAC and MP3 files. This process might take a while, depending on the size of your collection. You can start playing music when EMMS: All track information loaded
shows in the minibuffer.
Play music with EMMS
Phew, we can finally start enjoying the music collection. The basic principle is that you move tracks to the playlist buffer.
The browser is the most convenient way to select the music of your liking. You start the browser with emms-browser
(C-c w m b
). Loading the browser for the first time in an Emacs session might take a while if you have an extensive music collection.

When in the EMMS browser, use the b
key followed by a number to browse by artist, album, genre, year, composer or performer. The browser is collapsed by default, showing only album covers, artist names, or whatever you select as the browsing category. The browser is hierarchical. When, for example, browsing by genre, the hierarchy has four levels Genre > Artist > Album > Track. Use the 1
to collapse and the 2-4
keys to expand the categories at levels 1 to 3.
As is the case in most Emacs applications, press ?
for a list of available keystrokes, such as:
r
: Jump to a random entrys
: Search by album, artist, title, performer or composerEnter
: Add selection to playlistC-j
: Add selection to playlist and playW
: Lookup entry on Wikipedia
Being an Emacs buffer, standard search commands will also work for visible entries.
When the cursor is on a category, such as an album name or a composer, it will add all tracks belonging to that category. So when the cursor is on an album it will add all tracks. When the cursor is on a single track, it will only add that track to the playlist.
You jump to the playlist with emms
(C-c w m e
), from where you can manage what you play. Press ?
for a list of keyboard shortcuts, some of which are:
n
/p
: Next or previous trackr
: Play a random track.D
: Remove selected track from playlistC
: Clear playlist
Once you have curated a funky playlist, keep it for future reference. You can save a playlist buffer in m3u
or pls
format for use in other multimedia players using the save-buffer
command (C-x s
). The emms-play-playlist
function (C-c w m p
) lets you load and play a saved playlist.
The configuration above also sets the multimedia buttons on your keyboard (play, pause, next, previous). The MPRIS (Media Player Remote Interfacing Specification) extension ensures that these buttons also work when you are playing music with EMMS but are not in Emacs.
EMMS has many advanced features available for advanced control of your sound collection. Some other useful EMMS functions are:
emms-play-directory
: Add directory to playlistemms-play-find
: Plays all files in the music directory that match a given search criterion.
This is only the start of using EMMS. The Emacs Multimedia System has a plethora of options you can use to fine-tune your listening experience. Read the EMMS manual with the info browser (C-h i
) for detailed information about the various options.
Emacs Writing Studio
If you like to support my work, then please purchase the Emacs Writing Studio book.
Emacs Writing Studio
A comprehensive guide for writers seeking to streamline their workflow using Emacs. The book covers everything from organising ideas and writing distraction-free to publishing in multiple formats. It’s perfect for both beginners and experienced Emacs users, offering practical tips and a tailored configuration to enhance your writing process.
You can find the source files for the book and the latest configuration files on GitHub:
Emacs is a malleable system, and everybody has personal preferences on how to undertake a task and configure Emacs. Any article on how to use Emacs is thus opinionated. If you have a different way of doing things, please complete the contact form to send me an email or contact me on social media.
The ingestion process of the Emacs Writing Studio workflow is now complete. The next article in this series starts the ideation process and describes how to take notes with Org mode.
Share this content