Project 13A: Installing MP3 Support for XMMS

 < Day Day Up > 



As I mentioned, XMMS can play audio files in just about any format. However, Red Hat, the company, removed MP3 support for XMMS from its products because of those patent and licensing issues I mentioned at the beginning of the chapter. This means that if you want to play MP3s or MP3 streams with XMMS, you will need to install a patch in order to do so.

If you don’t believe me, or just don’t understand what I am talking about, see for yourself. Place an MP3 file on your hard disk, and then double-click it. XMMS will open, as will another small window, giving you a no-can-do-MP3s message.

13A-1: Downloading and Installing the XMMS MP3 Patch

The XMMS MP3 patch can be easily downloaded and installed via Synaptic. Just run Synaptic by going to the Main menu and selecting System Tools > Synaptic (or System Settings > Synaptic, if that is where it is on your system).

Once Synaptic is up and running, just type XMMS-mp3 in the Find box, and then follow the simple procedure for installing packages via Synaptic that you learned in Chapter 10.

13A-2: Trying Out the XMMS MP3 Patch

Once the patch is installed, you can try it out quite easily by double-clicking any MP3 file on your hard disk (and if you don’t have one now, you should make one using Grip, as you learned to do earlier in this chapter). XMMS will then open up, and the file you clicked will start playing. As you will see, there won’t be any no-can-do-MP3s message this time.

Creating XMMS Playlists

XMMS can play M3U playlists created by Grip, but it can also create playlists as well. Let’s say that you want to create a playlist of your favorite songs by various artists, but these songs are located, quite naturally, in a variety of different folders.

To create this “My Faves” playlist, just add each song you want to the XMMS playlist window, which you can do by clicking the small Add button at the bottom of that window (shown in Figure 13-9 on page 180). This will open the Load Files window (see Figure 13-11), in which you can locate the first file and click Add Selected Files. Then in the same Load Files window, navigate to the each additional tune you wish to add to your list, clicking Add Selected Files for each tune. (You can ignore the Add button in the Load Files window.)

click to expand
Figure 13-11: Adding songs to the XMMS playlist via the Load Files window

Once you’ve added all the files you want, you can see all the titles in the Playlist window (see Figure 13-12). If everything looks as you want it to, click, but don’t release, the List button at the bottom-right corner of that window. Then select


Figure 13-12: A new playlist shown in the XMMS playlist window

Save from the pop-up menu, and release the mouse button. This will bring up a Save Playlist window, where you should type in /home/username/ogg/playlisttitle.m3u (substitute your own username and playlist title for username and play-listtitle). In my case, for example, I typed in /home/rg/ogg/MyFaves.m3u. Once you’re done, click OK, and XMMS will save your new playlist. After that, all you have to do to play the list is double-click the M3U file for that list.

Using XMMS to Listen to Streaming Media

One of the coolest features of the Internet is streaming media, which is essentially live or taped audio or video Internet broadcasts. Such broadcasts can come in a variety of streaming formats, which are basically compression formats that allow data to move across the Net at as small a size as possible. Unfortunately, Linux cannot yet deal with the two most common of these formats, Microsoft’s Windows Media Player and Apple’s QuickTime, at least not in any simple way. Fortunately there are other media streaming formats out there on the Net, such as RealMedia. In addition, as streaming media formats are essentially space- saving compression formats, it is only natural that MP3 and Ogg Vorbis, both audio compression formats themselves, have also come to be used as streaming media formats for Internet audio broadcasts.

Ogg Vorbis Streams

In addition to allowing you to save music to disk in the form of Ogg files, Ogg Vorbis is also used for streaming media across the Internet. Compared to the number of MP3 streams, however, the number of Ogg Vorbis broadcast streams is still rather limited. Things seem to be changing, though, and the number of Internet broadcasters who are experimenting with Ogg Vorbis seems to be increasing, albeit very slowly.

Radio France is a good example of one of these Ogg Vorbis broadcasters. Radio France has a number of program streams for Internet listeners in Windows Media Player format. It also has now begun to “expérimente” (its word, not mine) with providing Ogg Vorbis streams for all of their broadcast programs. The stream I recommend you try out is Fip, which is an exceedingly cool eclectic collection of music of all genres; you will be constantly surprised by what they play. If you are worried about language, don’t; there is very little talk, and roughly 80 percent of the music played is in English. I don’t speak any French other than je suis fatigué, but I have no problems at all.

If you want to give streaming media in general, and Radio France in particular, a try, then right-click any open space in the main XMMS window, and from the pop-up menu, select Play Location. In the Location window that pops up, type http://ogg.tv-radio.fr:1441/encoderfip.ogg, and then click OK. Assuming you are already connected to the Internet, Fip should start playing after a few seconds of pre-buffering.

If you would like to be able to play Fip again in the future without having to type the somewhat lengthy URL each time, you can create a clickable launcher of sorts in your Home folder by saving the Fip location as a playlist. As in the preceding section, click, but do not release, the List button in the bottom-right corner of the Playlist window. In the pop-up menu, select Save, which will bring up a Save Playlist window. In the Selection box at the bottom of that window, type Fip.m3u, and then click OK.

Once you’ve done all that, a Fip.m3u file will appear in your Home folder. Now, whenever you want to listen to Fip, just double-click that icon, and XMMS will open and start bringing you a dose of eclectia, provided, of course, that you are connected to the Internet at the time.

If you would like to try any of the other Radio France broadcast streams, go to www.radiofrance.fr/services/aide/difflive.php#ogg, and you will find a list of addresses.

If the more traditional variety of pop and rock is your cup of tea, another broadcaster offering Ogg Vorbis streams is Virgin Radio. Virgin Radio has both standard pop/rock and classic rock broadcast streams. To listen to Virgin Radio, go to the Virgin Radio site at www.virginradio.co.uk/thestation/listen/ogg.html. Once there, click the appropriate link (modem or broadband) for the program stream you’d like to hear.

Once you do that, Mozilla will display a window (see Figure 13-13) to ask you what program you want to use to open the Ogg file type. Select Open it with, and in the accompanying box type /usr/bin/xmms. Then click OK. Mozilla will open XMMS, and the Virgin Radio stream will start playing. From now on, whenever you try to play an Ogg Vorbis stream, Mozilla will automatically start XMMS to play it.

click to expand
Figure 13-13: Instructing Mozilla to play Ogg streams with XMMS

SHOUTcast (MP3) Streams

As you have just learned, XMMS can play Ogg Vorbis streams, but now that you have installed MP3 support, it can also play SHOUTcast MP3 streams. To give this a try, go to www.shoutcast.com where you will see an extensive listing of SHOUTcast MP3 streams. Once you find a stream that seems of interest to you, click the Tune In button for that stream.

When you do this, Mozilla will pop up another one of those what-should-I- do-with-this-file windows. Just type /usr/bin/xmms in the Open with box and click OK, and XMMS will open and soon begin playing the stream. Now, any time you try to play a SHOUTcast stream in the future, Mozilla will know what to do with it.

Inputting Proxy Settings for Ogg Vorbis and SHOUTcast Streams

If your Internet provider has you behind a firewall, you will not be able to listen to broadcast streams with XMMS unless you input the proxy server settings given to you by your service provider. You can do this by right-clicking anywhere in the XMMS window and selecting Options > Preferences in the pop-up menu. When you do this, the Preferences window will open.

To input your proxy settings for Ogg Vorbis streams, scroll through the items in the Input Plugins pane, select Ogg Vorbis Player, and then click the Configure button, which will open the Ogg Vorbis Configuration window (see Figure 13-14). In that window, check the Use proxy checkbox and type your proxy information in the Host box. When you’ve finished, click OK to exit the Ogg Vorbis Configuration window, and then in the Preferences window, click Apply to apply your changes.

click to expand
Figure 13-14: Inputting proxy settings for Ogg Vorbis streams in XMMS

To input proxy settings for SHOUTcast streams, scroll through the items in the Input Plugins pane again, but this time select MPEG Layer 1/2/3 Player. Once you’ve done that, click the Configure button, which will open the MPG123 Configuration window. In that window, click the Streaming tab, and in that page click the Use proxy checkbox. Now input the proxy settings you received from your Internet provider or network administrator. You should also click the Enable SHOUT/Icecast title streaming checkbox near the bottom of the page. Once you’ve done all this, click OK to close the window. Then, back in the Preferences window, click Apply once (which will make the changes take effect immediately), and then click OK to close the Preferences window.



 < Day Day Up > 



Linux for Non-Geeks. A Hands-On, Project-Based, Take-It-Slow Guidebook
Linux for Non-Geeks: A Hands-On, Project-Based, Take-It-Slow Guidebook
ISBN: 1593270348
EAN: 2147483647
Year: 2003
Pages: 188

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