Listening to in Emacs

During the backup process before I had upgraded my notebook to Fedora 10, I decided not to copy back my Music folder to the fresh installation, but start using whenever I’d like to listen to music. The question came quite straight—so how to play streams in Emacs?

Emacs has its great multimedia system, which has support in development stage. Following the instructions on EMMS‘s homepage and rizoma’s dotemacs, soon I got working under my Emacs.

(To be exact, I used the EMMS source code patched by tsdh. It has some convenient addons.)

Put the following to into your dotemacs:

(add-to-list 'load-path "~/elisp/emms/")
(require 'emms-setup)

At this point, you’re almost ready to play the radio. You still need to set your username and password. For the former, you may simply customize `emms-lastfm-username‘ for future sessions, but for the latter, I don’t recommend you to store your password in a plain text file—you’d rather add the following advise into your dotemacs, that asks you interactively for your password every time you start the radio.

(defadvice emms-lastfm-radio (before read-passwd (lastfm-url))
  (if (string= emms-lastfm-password "")
      (setq emms-lastfm-password (read-passwd "Password: "))))

(ad-activate 'emms-lastfm-radio)

Go listening to!

M-x emms-lastfm-radio-similar-artists RET angelspit

With the offical code, try this:

M-x emms-lastfm-radio RET lastfm://artist/Imperial brothers/similarartists