Play Music


Do you think Elvis is alive? I mean, there's plenty of fake evidence to suggest that he is alive somewhere working as an elderly Elvis impersonator, or working in a gas station, or taking it easy in some rest home somewhere (see Figure 11.1). He is probably listening to music on a computer. If Elvis is alive, I know what I want to ask him. "Do you prefer OGGs or MP3s?"

Figure 11.1. Elvis as he appears today listening to his digital music collection.


There are so many different ways to listen to music on your computer, in different file formats and with different programs. There are purchased CDs, burned CDs of custom playlists, online music services, and portable music players. I could use the opinion of an expert such as Elvis. I am sure that he has become a digital music aficionado in his old age. If we can't get Elvis's opinion at the moment, how do you differentiate among all of those options? Linux can accommodate most sound and video file formats, and there are a number of good programs to play those formats. That is a lot to choose from. Before I break out the Elvis CDs, we need to learn more about music file types and players in Linux.

File Type Fight

MP3 is the most ubiquitous audio format, but there are many more. I'm not sure whether you are an audiophile, but many audiophiles argue quite a bit over the best quality level and format for digital music. I'm just a user with a pair of pretty good speakers on my computer. I liked OGG files because they sounded cool and were an open format, but in the end, I have stuck with MP3s simply because it is easier to port them between computers, between operating systems, and onto portable players. See Table 11.1 for a synopsis of the most common audio file formats.

Table 11.1. Description of Common Digital Audio Formats

FILE TYPE

DESCRIPTION

AAC

Mostly known as the file type used in Apple's iTunes, but can be played by some Linux applications if they are unencrypted. This is a lossy compressed format with improved quality over MP3. AAC files from iTunes can sometimes have the file extension MP4, and some are copy protected.

CDA

(CD Audio) These are the files on purchased audio CDs when they are copied to a computer. They are uncompressed and can be ripped to compressed file types for use in digital music players.

FLAC

The abbreviation stands for Free Lossless Audio Codec. It is a high-quality public domain format used by a few online music services.

MP3

This is the most popular format for digital music, which can be played in most digital players and most portable players. MP3 is a lossy compressed format, meaning that quality can vary. There are a few different quality levels, or bit rates, MP3s can be saved at, including 128Kbps and 192Kbps.

MPC

This is a newer format similar to MP3, but with higher quality when compressed. This format is not yet supported in most digital music programs or portable players.

OGG

(OGG Vorbis) OGG is the geeks' format for digital music. The format is public domain and considered by many to be higher in quality than MP3 files encoded at the same bit rate. OGGs are making headway in popularity and are supported by most Linux players and a few portable players.

WAV

You know those annoying sound schemes in your operating system? Those would be WAV files. They have been around for a long time. The format is uncompressed, takes up a lot of disk space for larger files, and is the pit stop format between CDA and MP3 when ripping purchased audio CDs.

WMA

(Windows Media Audio) Microsoft created this format for use in its Windows Media Player. Many online music services use the format because Microsoft has made it easy for those services to build in copy protection, also known as digital rights management (DRM). WMAs are considered higher-quality audio than MP3s. These files can be played on a couple Linux players but are mostly intended for Windows Media Player.


Grip

Program Info

Fedora/GNOME menu

Sound & Video > Grip

Terminal command

grip

Program URL

http://nostatic.org/grip


This is one of the most popular programs for ripping audio CDs to a digital format. Other applications are available for ripping, but Grip is the most developed and useful. Grip supports ripping audio CDs to MP3, OGG, WAV, and FLAC. It also has a full-featured CD player built into the program, lookups to an online database for CD information, playlists, and the capability to add and edit ID3 tags.

When you rip an audio CD to MP3 files, the most common format that you want to convert to, the tracks on the CD go through a few steps. First, they are converted to uncompressed WAV files. Then they are compressed and encoded into MP3 files. Grip features the capability to simultaneously rip and encode, which makes the long process of ripping a CD go a little faster. Because of the WAV step in the process, you want to make sure that you have plenty of free disk space for Grip to save those WAV files to temporarily.

Grip's interface is a series of tabs with settings and options on each tab. CD player controls are in the bottom of the window. The Tracks tab (see Figure 11.2) is a list of the tracks on the CD. The far right column, Rip, is full of check boxes to mark which tracks you want to rip. The Rip tab (see Figure 11.3) is where you start the process, with buttons for Rip+Encode, Rip Only, and two abort buttons. The last button, DDJ Scan, is for use if you have a program called Digital DJ (see http://www.nostatic.org/ddj/) installed. The indicators below those buttons show you progress on current actions. The Config tab is where most of the action is. A lot of options in here might sound cryptic to you. I suggest that you try ripping a few CDs using the default settings first. You can play with adjusting options afterward. You can check out Grip's built-in help docs for information on advanced configuration, but you most likely will need to change only your personal preferences for file naming and locations. The Status tab scrolls status messages in an embedded window.

Figure 11.2. Grip's Tracks tab.


Figure 11.3. Waiting for Grip.


UNDER THE HOOD

ID3 ME

Digital audio formats such as MP3 and OGG contain track information about the song or audio embedded in the file. The standard format for track information in MP3s is the ID3 tag. The tags have set fields for artist, song title, album, genre, year, and more. OGGs use a similar format called OGG tags.


Down below in the Grip window are the CD player controls. The Toggle Disc Editor button shows a pane for editing each track's ID3 tags. You can use Initiate/Abort Disc DB Lookup to start and stop lookup for info about your CD online. Toggle Track Display shows the small, CD player view of Grip.

TOOL KIT 11.1

Rip Your Elvis CD with Grip

1.

Grab an audio CD and put it in your computer. I am going to use Elvis: 30 #1 Hits. I think there might be evidence on there about Elvis's current location. With or without evidence, I know that I want "A Little Less Conversation" ripped to an MP3. That's a cool song.

2.

Depending on your desktop environment defaults, you will probably have a CD player pop up automatically when you put in your music CD. Close that program and open Grip instead. The command is grip, or you can find it by going to your main menu and looking under Multimedia or Sound & Video.

3.

Wait a few seconds if you are online right now. Grip contacts the Disc DB online database to gather track information about your CD so that you don't have to type it all in. If you are not connected to the Internet or your CD is not found, use the Toggle Disc Editor button to fill in track information on your own.

4.

Click the Rip column to check the boxes for every track on the CD in the Tracks tab.

5.

Move to the Rip tab and click the Rip+Encode button. Things get started right away. You can watch the progress on the indicators below the buttons (see Figure 11.3).

6.

By default, Grip puts your new MP3 files into /home/[username]/mp3, or sometimes /home/[username]/ogg, even though it saves the files as MP3s. You can adjust the location files are ripped to in Config > Encode > Encode File Format. In this field, you can also change the filename scheme. The text in that field uses switches. You can view a list in the Grip help docs. Some common options are %A for Artist, %d for disc title, %n for the name of the track, and %t for the track number.

7.

The CD ejects when Grip is done.


Ripping CDs can hog a lot of your system's memory and processor resources, so you might want to step away from the computer and read the liner notes or something while you wait. Take a look at the resulting files that you ripped to MP3s to see if you like the directory location and filename format. If you have trouble encoding your files, look in Config > Encode > Encode File Format at the encoder being used. You might not have the selected encoder installed. You can obtain most of the encoders in the drop-down list by looking up the name in that list as a package name to install using your favorite method of installing new software.

Rhythmbox

Program Info

Fedora/GNOME menu

Sound & Video > Music Player

Terminal command

rhythmbox

Program URL

http://www.rhythmbox.org/


Someone liked Apple's iTunes a lot, so that person made Rhythmbox. In some circles, that might be construed as stalking, but with open source software, it's more of a tribute. The program has a layout very similar to iTunes, with browsing panes in the window and a Sources column. If you are used to iTunes, don't expect too much; Rhythmbox isn't the same. It is sort of like iTunes on vacation, with only the most basic playback and playlist functions available. Rhythmbox is, however, my favorite player in Linux right now because I like being able to browse my music in its Library view and easily set up playlists. I enjoy those functions more than I need pretty visualizers and interesting application skins.

Upon first running Rhythmbox, you go through a wizard to add your music files to your music library. You can skip the step if you would prefer to add your music later. To add your music now, navigate to the directory your music is in and add it. Fedora users have a hitch in the process: You might not have MP3 support in Rhythmbox yet. Check out ToolKit 11.2 to add support for that file type.

TOOL KIT 11.2

Add Mp3 Support to Rhythmbox in Fedora

Fedora doesn't include MP3 support in any of the players included with the distribution; a company named Thomson has claimed licensing rights to the MP3 format. Many companies, including Microsoft, NullSoft (the makers of WinAmp), and Apple, have acknowledged this claim and paid licensing fees. Red Hat and Fedora prefer to ship their distro with only software that complies with the General Public License; they do not include MP3 support because the format is not under the GPL. Half of all of our brains says, "Good for you, Fedora! Way to stick to your principles." The other half of our brains says, "@&$%#! Now how do I make that work?!"

A group at http://rpm.livna.org maintains a repository of missing and helpful files for Fedora. URLs change with time, so if the URLs we talk about here stop working, go to http://www.fedorafaq.org to find out how to add MP3 support. Let's go over this using Apt. If you have chosen to use Yum for updates, the steps are mostly the same:

1.

Log in to your terminal as the root user and then edit the Apt sources file:

 # gedit /etc/apt/sources.list 

or

 # kate /etc/apt/sources.list 

2.

Add the new sources to your list by adding these two lines:

 rpm http://rpm.livna.org/ fedora/2/i386 stable unstable testing rpm-src http://rpm.livna.org/ fedora/2/i386 stable unstable testing 

(Those are the Fedora Core 2 repositories on livna.org. Check the page at http://rpm.livna.org for other Fedora releases.)

Save the file and close your text editor.

3.

Update Apt so that the new repositories are included:

 # apt-get update 

4.

Install the Gstreamer package that Rhythmbox needs for Mp3 support:

 #apt-get-install gstreamer-plugins-mp3 

This package also installs the other package that you need, libmad.

5.

Open Rhythmbox, and you should be ready to go.

6.

As a last step, you might want to open the sources.list file again to either delete or comment out those two new repositories. (Comment them out by placing a # in front of each line.) You can keep them handy for any future packages that you might want to install or update from that group, but you shouldn't include those repositories if you perform a dist-upgrade.


Rhythmbox is set up in a simple three-pane layout (see Figure 11.4). On the left is the Sources column, with access to the library view, to streaming locations in the Radio view, and, after you have created some, to views of your playlists. The Artists pane is a list of all the artists of the files you have added to your library. The artist information is gathered from each file's ID3 or OGG tag. The Album pane lists each album from the tags of your music files. The Tracks view, below the artists and albums, shows the tracks that match the criteria from the Artists selection, Albums selection, or search criteria. Up near the toolbar, you find a volume control, a Search box, and a track progress slider.

Figure 11.4. Rhythmbox's Library view.


TOOL KIT 11.3

Import MP3 Files to Create a Playlist in Rhythmbox

Import the King

1.

Open Rhythmbox and then go to Music > Import Folder. You can also press Ctrl+O.

2.

Navigate to the directory you want to import files from. Our new MP3 files that we ripped in ToolKit 11.1 are in /home/[username]/mp3/.

3.

Select the directory and click Open.

4.

That's it. You can now view the files in the Library view.

Create a Playlist

1.

In the menu bar of Rhythmbox, go to Music > Playlist > New Playlist. You can also press Ctrl+N.

2.

In the Sources column, on the left, you see your new playlist and an empty text box for naming it. I'm naming mine Elvis Pants. Notice that the right side of the Rhythmbox window switched from the regular browsing layout of the library view to an empty list.

3.

Let's fill up that empty list. Go back to the Library view by clicking Library in the Sources column. Use the browsing functions to find the songs you want to add to the playlist.

4.

Highlight the track and then drag and drop the item onto your new playlist in the Sources column. You can highlight multiple songs to add more than one at a time. Click your playlist to see what was added.

5.

To play, double-click a track in your playlist, or click the playlist and then the Play button.


When you have a working playlist set up, you can manage the songs on it. Use your Delete key to remove songs from the list. You can reorder your playlist by dragging and dropping songs in the order. You can also drag tracks from one playlist to another.

Noatun

Program Info

Mandrake/KDE menu

Multimedia > Sound > Noatun

Terminal command

noatun

Program URL

http://noatun.kde.org


This is KDE's default player. Noatun is pretty plain when you first open it. There are a few basic controls on the toolbar, a couple menus, and a big progress slider to indicate where you are in the file you are playing. You can open other Noatun windows along with the main window, such as a playlist and visualizer. The program supports a variety of media types, including OGG, MP3, and WAV files. Another cool feature available is skinning (see Figure 11.5).

Figure 11.5. Noatun with the Phong skin.


To play a song in Noatun, go to File > Open, find the file or directory you want to play, and then click OK. This adds the song to your playlist. If you don't have the playlist window open, click Settings > Show Playlist. There is also a toolbar icon for the playlist. Simply highlight a song and click the Play button on the toolbar or double-click the song in the playlist.

Skinning in Noatun is different than in other programs. Skins are added as plug-ins, and they can rearrange the whole program. Although the default skin is plain vanilla, you can find some very interesting skins on Noatun's Web site at http://noatun.kde.org/.

TOOL KIT 11.4

Skin Noatun to Play Your CD in Style

Not as many skins are available for Noatun as there are for XMMS, but they do more fun stuff. Let's add one of the K-Jofol set of skins.

1.

Open Noatun and then go to Settings > Configure Noatun.

2.

Go to Plug-ins. You might see a warning about your playlist stopping play, but you can click OK. You'll see a list of interfaces, many of which you already have installed by default.

3.

Uncheck the default skin, Excellent, and then check K-Jofol.

4.

When you click OK or Apply, your Noatun interface changes to use the new skin and looks something like Figure 11.6.

Figure 11.6. Noatun with a K-Jofol skin.



You can download new skins from the Noatun Web site and from KDE Look (see http://www.kde-look.org/). You might have noticed that there was also an option for a WinAmp skin loader. This option lets you skin Noatun with any of the tons of WinAmp 2.x skins available online (see http://winamp.com/).

UNDER THE HOOD

MUSIC MOBILITY

Linux developers love gadgets, including portable digital music players. There is a lot of support for various popular MP3 players. Dell's Digital Jukebox player is built to sync with Linux. Dedicated users also have written support for other portable players. The methods for how players sync with a given Linux program differ quite a bit, so do a quick search online for your particular player to find tutorials and reviews.


XMMS

Program Info

Fedora/GNOME menu

Sound & Video > Audio Player

Terminal command

xmms

Program URL

http://www.xmms.org


This is the grandpa program of GUI digital audio players in Linux. XMMS has been around for a while but has stayed pretty popular throughout that time, just like the player that it is modeled after, WinAmp. As with many Linux programs, someone switched over from Windows, said, "I miss WinAmp," and made this version. XMMS is a solid little player that supports MP3, MOD, WAV, OGG, and others using plug-ins. There are plug-ins for some video support as well, but that function isn't very well developed for XMMS. This player is made for music.

There are a few different window components to XMMS (see Figure 11.7). The three windows can be moved separately or together as a unit. The Main window contains the playback controls, volume control, progress slider, shuffle and repeat buttons, and playback display, which shows you information about the song you are playing. You can drag the Main window with your mouse and have the Equalizer and Playlist windows move with it. The Equalizer window has a graphic equalizer on it with several slider controls to adjust the spectrum of sound. The Playlist window lists the current playlist.

Figure 11.7. XMMS, with the equalizer and playlist in view.


An Ode to iTunes

I used to be normal and listened to my music without thinking about how it was arranged or where I got it. Then I used iTunes. My digital music world changed. I cared about my ID3 tags. I wanted Smart Playlists and easy online purchase of songs, albums, and audio books. I was forever spoiled for normal MP3 listening. Rhythmbox makes up for my loss in many features, but it is like giving methadone to a heroin addict. The pool of needy, potential iTunes users in Linux isn't large enough yet to convince Apple to make a Linux version. There is hope, though. I read that someone got iTunes for Windows to work in Crossover Office (more on that program in Topic 13, "Running Windows Applications"). I won't stop begging Apple for a Linux version of iTunes, but I will try this hopeful alternative.


XMMS arranges its windows and menus differently than other programs. You can access XMMS menus by right-clicking almost anywhere in any of the windows, just not in the list part of the Playlist window. Most of the menu options are for doing playback control and toggling the three window options in and out of view. In the Options menu, you can adjust many settings and change which skin XMMS displays. The Visualization menu has options for showing visualizer displays. Visualizations are digital light shows that often move with the beat of the music you play. There are a few built-in patterns and more available to download online.

TOOL KIT 11.5

Add Mp3 Support to XMMS in Fedora

Read the beginning of ToolKit 11.2 to find out why you even need to mess with this. Fortunately, adding MP3 support to XMMS is cake.

1.

You simply need to install the package named xmms-mp3. You should be able to do that from Freshrpms.net's repository using Apt or Yum. You can also get the package from Guru Labs (see http://www.gurulabs.com/downloads.html).

2.

Update Apt like normal:

 # apt-get update 

3.

Install the xmms-mp3 package that XMMS needs for MP3 support:

 #apt-get-install xmms-mp3 

4.

Open XMMS, and you should be ready to go.




Linux Desktop(c) Garage
Linux(R) Desktop Garage
ISBN: 0131494198
EAN: 2147483647
Year: 2006
Pages: 141

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net