Hack 18. Manage Your Audio with XMMS
XMMS is a classic Linux audio player you can use to easily play a number of different audio file types.
A number of audio players are available under Linux, but XMMS is a classic that you are likely to find available no matter which Linux distribution you use. XMMShas an interface similar to Winamp under Windows and can play most popular audio formats, including MP3, WAV, Ogg Vorbis, and audio CDs, along with many other formats, if you install the proper input plug-in.
The default XMMS interface has controls to play, pause, stop, and skip forward and backward in your playlistbelieve me, they're all there, just very tiny. To open the playlist editor, click the button labeled PL on the interface, right-click on XMMS, and select Playlist Editor, or type Ctrl-E. Within the playlist editor, you can add, delete, arrange, and sort tracks. To add tracks, select the add button and browse to the directory, or simply drag and drop files from your file manager onto the playlist. You can also save playlists you have created so that you can refer to them later. All playlist options that are available via buttons on the bottom of the interface can also be accessed if you right-click on the playlist. The audio settings are adjusted with the equalizer. To display the equalizer, click the EQ button next to the PL button on the interface, right-click, and select Graphical EQ, or type the keyboard shortcut Ctrl-G.
Once the playlist has been set up, click the play button or type x. The buttons to control playback including previous track, play, pause, stop, and next track can be accessed with z, x, c, v, and b, respectively. Notice how all of the keys on the keyboard line up in the same order as on the interface. As a track is playing, you can control the volume and balance directly from the main window. To skip ahead in a track, just click and drag the long bar that slowly progresses along the window. The main window also has checkboxes so that you can toggle shuffle and repeat modes for the playlist.
XMMS is a highly configurable application that supports a number of plug-ins for input, output, visualization, and other options. The most popular plug-ins can be downloaded directly from http://www.xmms.org and extracted into your ~/.xmms/Plugins directory. Right-click XMMS and select Options Preferences or type Ctrl-P to access additional XMMS options. The preferences window (see Figure 2-3) has tabs organizing different XMMS plug-ins and options:
Figure 2-3. XMMS Preferences
2.7.2. XMMS Command-Line Control
One of the particularly useful features of XMMS is that you can control much of it directly from the command line. Table 2-2 lists some of the more useful XMMS command-line arguments.
The playlist control options are especially handy if you have a multimedia keyboard, as you can use your desktop environment's keybinding editor to run the particular XMMS command for that function. Even if you don't have a multimedia keyboard, you might want to bind a key sequence to some of these keys. For example, to toggle between pause and play, tell your keybinding program to run xmms --play-pause.
The -e option is also useful to quickly add tracks to the playlist. To add, for instance, your entire Ramones collection to the playlist, you could type:
$ xmms -e ~/mp3/ramones
Of course, change the path to the path of the files you wish to add. If you ran that same command without the -e option, XMMS would still load those files into the playlist, but it would also clear out the playlist beforehand. When XMMS exits, it remembers the contents of the playlist, and next time you start it, it will reload that playlist unless you tell it otherwise.