Media player

From WikEmacs
Revision as of 21:31, 28 October 2012 by Elvince (talk | contribs) (Usage: added the command list)
Jump to: navigation, search


EMMS, The Emacs Multimedia System.

EMMS is the Emacs Multimedia System. It tries to be a clean and small application to play multimedia files from Emacs using external players. Many of it's ideas are derived from MpthreePlayer , but it tries to be more general and cleaner.

The fact that EMMS is based on external players makes it powerful, because it supports all formats that those players support, with no effort from your side.


  • Free Software (as in Free Speech, and Free Beer)
  • Extensible
  • Very light (some might even say stealth)
  • Audio support : MP3, Ogg Vorbis, FLAC
  • Video support : MPEG, WMV, MOV, AVI, OGM, MKV, etc...
  • Tagging capability, possibly batched
  • Playlist management
  • Remotely drivable via emacsclient (playlist creation via rox-filer, for example)
  • And last but not least : Written in Emacs lisp :)


Install the needed packages with the package manager of your system :

sudo apt-get install emms vorbis-tools

(you may also try with el-get.)

add the following to your ~/.emacs :

(require 'emms-setup)

and, as usual, restart emacs or M-x eval-current-buffer RET.


You can play a file or a directory with the command M-x emms-play-file or emms-play-directory.

You can add files and directories to the emms playlist (which will be created if it doesn't exist yet) with M-x emms-add-file, play it with emms-start and you can visit the playlist buffer by simply calling M-x emms RET. Hitting '?' in the playlist buffer will show you all the available shortcuts.

Add other file extensions

If you want to, say, be able to read flv videos :

;; add flv and ogv
(define-emms-simple-player mplayer '(file url)
      (regexp-opt '(".ogg" ".mp3" ".wav" ".mpg" ".mpeg" ".wmv" ".wma"
                    ".mov" ".avi" ".divx" ".ogm" ".asf" ".mkv" "http://" "mms://"
                    ".rm" ".rmvb" ".mp4" ".flac" ".vob" ".m4a" ".flv" ".ogv" ".pls"))
      "mplayer" "-slave" "-quiet" "-really-quiet" "-fullscreen")


Get lyrics of current song

We have to install emms-get-lyrics.el.

With el-get : el-get-install RET emms-get-lyrics RET.

Or :

(add-to-list 'load-path "~/.emacs.d/my-extensions/")
(require 'emms-get-lyrics)
  • M-x evaluate-current-buffer

Then start playing a song and call M-x emms-get-lyrics-current-song.

Excerpt from its documentation :

The function 'emms-get-lyrics-current-song' tries to get the lyrics of the song that emms is currently playing [from]. It currently requires w3m to get the lyrics. It copies the lyrics to a file ending in .lyrics; if the variable `emms-get-lyrics-use-files' is nil, it will just display the lyrics in a buffer without saving them to a file. If the variable `emms-get-lyrics-dir' is non-nil, then the lyrics will be put in this directory with the file ARTIST-TITLE.lyrics; otherwise it will be put in the same directory as the song file, in a file with the same name as the song file except the extension will by ".lyrics".

External links an easy tutorial to begin with.


mpg123 is a package written by HiroseYuuji for playing .mp3 and .ogg files with the mpg123 and ogg123 programs.


Debian system

Install the mpg123-el package :

apt-get install mpg123-el

All systems

Install the mpg123 and ogg123 programs with your system's package manager :

apt-get install mpg123 ogg123

Grab the sources from mpg123.el's git repository and save them in ~/.emacs.d/mpg123.el.

Check you have the following in your .emacs :

(add-to-list 'load-path "~/.emacs.d/")

restart emacs or M-x eval-current-buffer.


M-x mpg123

start mpg123, choose a directory or a mp3/ogg file and start listening. The buffer shows a complete list of commands.
 1 --:--/--:--	 Hurricane by Kyuss
Volume: [N/A] Repeat: [--] Loop: [--]
W	Show the real filename
g	Go to current music line
SPC	Play or pause
RET	Play
m	Mark position (when playing)
r	Restart from marked position
w	Where is the marked position
<	<<
>	>>
f	Forward 1 sec
b	Backward 1 sec
F	Forward 10 sec
B	Backard 10 sec
n	Move to next line
p	Move to previous line
g	Go to current music line
-	Volume down
+	Volume up
o	Open other directory or playlist file
a	Add other directory or playlist file
S	Save current playlist to a file
i	Increase repetition count
d	Decrease repetition count (-1 for infinity)
L	Increase current loop count
l	Decrease current loop count. Also toggles between 0(no loop) and -1(always loop)
s	Shuffle music list
D	Delete music file
.	Display playing position indicator
k	Kill music line and push onto stack
y	Yank music line from stack
I	Intro-quiz mode ON/OFF (Stop at marked position)
q	Quit
Q	Quit without query
<down-mouse-2>	Select a music directly on the mouse cursor
0..9	Digit argument (ex. 50V increase volume by 50steps)
The delimiter line "-------" is the indicator of currently playing position.
You may see the slider on the line running from left to right while the
music's going ahead.  If you hit RET or <down-mouse-2> on the indicator line,
the music will immediately move to that position.

External links stuff to control mpg123.el from the outside.

sources :