Next: , Previous: New Player, Up: Extending Emms

19.2 Simple Player for `play'

Play is a very easy command line player for various format. If you want your emms to play WAV files just put the following lines in you .emacs:

     (require 'emms-player-simple)
     (define-emms-simple-player play '(file) "\\.wav$" "play")

Huh! Wasn't that easy?

The macro function define-emms-simple-player takes a minimum of three arguments. The first argument (play in our example) defines the name of the player. It's used to name the player functions. The second is a regexp, that defines which files to play with our player. \\.wav$ matches any filename ending with a dot and the string wav. The last argument is the actual command line command we use to play our files. You can also add the path but we just assume that the command is in your path. All arguments you add to these three are optional. They define the command line arguments you want to add to your argument. If you want to hear the wav file of your favourite artist in the most possible volume use the following line:

     (require 'emms-player-simple)
     (define-emms-simple-player play

Please notice that you have to add the arguments as strings!

The command line tool you use for define-emms-simple-player has to take one song as argument and stop after playing that particular song. For any other concept you will need to customise emms a bit more...