Archive for May, 2007

482Part IVRunning Applications2.Insert the music CD into (Free web hosting music) your

Saturday, May 5th, 2007

482Part IVRunning Applications2.Insert the music CD into your CD-ROM drive. (If a CD player opens on thedesktop, close it.) 3.Extract the music tracks you want by using the cdda2wavcommand. Forexample: # cdda2wav -D /dev/cdrom -BThis reads all of the music tracks from the CD-ROM drive. The -Boption saysto output each track to a separate file. By default, the cdda2wavcommandoutputs the files to the WAV audio format. Instead of extracting all songs, you can choose a single track or a range oftracks to extract. For example, to extract tracks 3 through 5, add the -t3+5option. To extract just track 9, add -t9+9. To extract track 7 through the endof the CD, add -t7. If you have a low-quality CD drive or an imperfect CD, cdda2wavmight not be thebest ripping tool. You might try cdparanoia -Bto extract songs from the CD tohard disk instead. 4.When cdda2wavis done, insert a blank CD into your writable CD drive. 5.Use the cdrecordcommand to write the music tracks to the CD. For example: # cdrecord -v dev=/dev/cdrom -audio *.wavThe options to cdrecordtell the command to create an audio CD (-audio) onthe writable CD device located at /dev/cdrom. cdrecordwrites all .wavfilesfrom the current directory. The -voption causes verbose output. 6.If you want to change the order of the tracks, you can type their names in theorder you want them written (instead of using *.wav). If your CD writer sup- ports higher speeds, you can use the speed option to double (speed=2) or toquadruple (speed=4) the writing speed. After you have created the music CD, indicate the contents of the CD on its labelside. It s now ready to play on any standard music CD player. Ripping CDs with GripFor GNOME users, the Grip window provides a more graphical method of copyingmusic from CDs to your hard disk so that you can play the songs directly from yourhard disk or burn them back onto a blank CD. Besides just ripping music, you canalso compress each song as you extract it from the CD. You can open Grip from the red hat menu by selecting Sound & Video.Grip (orbytyping gripfrom a Terminal window). Figure 19-6 shows an example of the Gripwindow. Note27_
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services

481Chapter 19Playing Music and (Make a web site) VideoIf you want to

Saturday, May 5th, 2007

481Chapter 19Playing Music and VideoIf you want to rip music files from a CD and compress them, you can use the Gripwindow (described later in this chapter). Grip enables you to select oggenc as thetool to do the file compression. If you re are interested in making a CD jukebox that rips, records, and compressesmusic CDs using oggenc and other open source software, check out the book LinuxToysby Christopher Negus and Chuck Wolber from Wiley Publishing. Recording and Ripping MusicWritable CD-ROM drives are a standard device on computers. Where once you hadto settle for a floppy disk (1.44MB) or a Zip disk (100MB) to store personal data, aCD-ROM burner lets you store more than 600MB of data in a format that can beexchanged with most computers. On top of that, you can create CD music disks! Both graphical and command-line tools exist for creating CDs on Linux. The cdrecordcommand enables you to create audio and data CDs from the command line, writingto CD-recordable (CD-R) and CD-rewritable (CD-RW) drives. This command is dis- cussed in the following section. Creating an Audio CD with cdrecordYou can use the cdrecordcommand to create either data or music CDs. You cancreate a data CD by setting up a separate file system and copying the whole imageof that file system to CD. Creating an audio CD consists of selecting the audio tracksyou want to copy and copying them all at once to the CD. This section focuses on using cdrecordto create audio CDs. cdrecordcan useaudio files in .au, .wav, and .cdrformats, automatically translating them whennecessary. If you have audio files in other formats, you can convert them to one ofthe supported formats by using the soxcommand (described previously in thischapter). One way to create an audio CD is to use cdda2wavto extract (copy) the music tracksto a directory and then use cdrecordto write them from the directory to the CD. Here s an example: If you prefer a graphical tool for copying and burning CDs and DVDs, refer toAppendix A, which describes how to use the K3B CD Kreator for burning CDimages. That tool can also be used for copying audio CDs. 1.Create a directory to hold the audio files, and change to that directory. (Makesure the directory can hold up to 660MB of data less if you are burningfewer songs.) For example: # mkdir /tmp/cd# cd /tmp/cdNoteTip27_
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision mysql5 web hosting services

480Part IVRunning ApplicationsIn its most basic form, you (Java web server)

Saturday, May 5th, 2007

480Part IVRunning ApplicationsIn its most basic form, you can convert one file format (such as a WAV file) toanother format (such as an AU file) as follows: $ sox file1.wav file1.auTo see what SoX is doing, use the -Voption. For example: $ sox -V file1.wav file1.vocsox: Reading Wave file: Microsoft PCM format, 2 channel, 44100 samp/secsox: 176400 byte/sec, 4 block align, 16 bits/samp, 50266944 data bytessox: Input file: using sample rate 11025size bytes, style unsigned, 1 channelsox: Input file1.wav: comment file1.wav sox: Output file1.voc: using sample rate 44100size shorts, encoding signed (2 s complement), 2 channelssox: Output file: comment file1.wav You can apply sound effects during the SoX conversion process. The followingexample shows how to change the sample rate (using the -roption) from 10,000KHz to 5,000 KHz: $ sox -r 10000 file1.wav -r 5000 file1.vocTo reduce the noise, you can send the file through a low-pass filter. Here s an example: $ sox file1.voc file2.voc lowp 2200For more information on SoX and to get the latest download, go to the SoX SoundeXchange home page (www.sourceforge.net/projects/sox/). Compressing Music Files with oggencThe oggenccommand takes music or other audio data and converts it from uncom- pressed formats (such as WAV, RAW, or AIFF) to the compressed Ogg Vorbis format. Using Ogg Vorbis, audio files can be significantly reduced in size without a noticeableloss of sound quality. (I used the default settings in oggencand reduced a 48MB WAVmusic file to 4MB.) In its most basic form, you can use oggencwith one or more WAV or AIFF files fol- lowing it. For example: $ oggenc *.wavThis command would result in all files ending with .wavin the current directory tobe converted to Ogg Vorbis format. An OGG file is produced for each WAV file, withoggencsubstituting .ogg for .wavas the file suffix for the compressed file. OggVorbis files can be played in many different audio players in Linux, including theXMMS player (described earlier).
Note: If you are looking for cheap webhost to host and run your apache application check Vision jboss web hosting services

479Chapter 19Playing Music (Web host forum) and VideoFile Extension DescriptionFile Extension

Saturday, May 5th, 2007

479Chapter 19Playing Music and VideoFile Extension DescriptionFile Extension Descriptionor Pseudonymor Pseudonym.hcomMacintosh HCOM files..maudAmiga format used toproduce sound that is 8-bit linear, 16-bit linear, A-law, and u-law in monoor stereo. .oggOgg Vorbis compressed .ossdspPseudo file, used to open audio, which is best used the OSS /dev/dsp file and for compressing music configure it to use the data and streaming audio.type passed to SoX. Usedto either play or record. .prcPsion record.app format, .sfIRCAM sound files, used newer than the WVE by CSound package and format.MixView sample editor. .sphSpeech audio SPHERE .smpSampleVision files from (Speech Header Resources)Turtle Beach, used to format from NIST (Nationalcommunicate with Institute of Standards anddifferent MIDI samplers. Technology). .sunauPseudo file, used to open .txwYamaha TX-16W from a /dev/audiofile and a Yamaha sampling set it to use the data type keyboard. being passed to SoX. .vmsUsed to compress speech .vocSound Blaster VOC file. audio for voice mail and similar applications. .wavMicrosoft WAV RIFF files. .wve8-bit, a-law, 8 KHz sound This is the native Microsoft files used with Psion Windows sound format.Palmtop computers. .rawRaw files (contain no .ub, .sb, Raw files with set charac- header information, so .uw, .sw, teristics. ub is unsigned sample rate, size, and style .ul, .al, byte; sb is signed byte; must be given)..lu, .la, uw is unsigned word; sw .slis signed word; and ul isu-law. If you are not sure about the format of an audio file, you can add the .autoextensionto the filename. This triggers SoX to guess what kind of audio format is contained inthe file. The .autoextension can only be used for the input file. If SoX can figureout the content of the input file, it translates the contents to the sound type for theoutput file you request.
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services

478Part IVRunning ApplicationsTools that come (Cpanel web hosting) with Fedora Core

Friday, May 4th, 2007

478Part IVRunning ApplicationsTools that come with Fedora Core for converting and compressing audio filesinclude: .sox(SoX) A general-purpose tool for converting audio files among a varietyof formats. .oggenc A tool for specifically converting music files to Ogg Vorbis format. Converting Audio Files with SoXIf you have a sound file in one format, but you want it to be in another format, Linuxoffers some conversion tools. The SoX utility can translate to and from any of theaudio formats listed in Table 19-1. Type sox -hto see the supported audio types, as well as supported options andeffects. Table 19-1Sound Formats Supported by SoX UtilityFile Extension DescriptionFile Extension Descriptionor Pseudonymor Pseudonym.8svx8SVX Amiga musical instru-.aiffApple IIc/IIgs and SGI AIFF ment description format. files. May require a sepa- rate archiver to work withthese files. .au,.sndSun Microsystems AU .avrAudio Visual Research audio files. This was once aformat, used on the Mac. popular format. The .snd extension is ambiguous because it s also been usedon NeXT format and head- erless Mac/PC format.) .cdrCD-R files used to master .cvsContinuously variable slope compact disks.delta modulation, which isused for voice mail andother speech compression. .datText data files, which con-.gsmLossy Speech Compression tain a text representation (GSM 06.10), used to of sound data.shrink audio data in voice mail and similarapplications. Tip27_
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services

477Chapter 19Playing Music (Web site hosting) and Video .Select files to

Friday, May 4th, 2007

477Chapter 19Playing Music and Video .Select files to play To select from the files in the playlist, use the previoustrack and next track buttons in the main XMMS window. The selected file ishighlighted. Click the Play button to play that file. Alternatively, you can dou- ble-click any file in the playlist to start it playing. .Delete files from the playlist To remove files from the playlist, select the fileor files you want to remove (use the next track and previous track buttons), right-click the playlist window, and click Remove.Selected. The selected filesare removed. .Save the playlist To save the current playlist, hold the right mouse buttondown on the List button and then select Playlist.Save List from the pop-upmenu. Browse to the directory you want, and then type the name you wanttoassign to the playlist and click OK. The filename should end with a .m3uextension, such as monkees_hits.m3u. .Load the playlist To reload a saved playlist, click the List button. Select aplaylist from the directory in which you saved it and click OK. There is also a tiny set of buttons on the bottom of the Playlist Editor screen. Theseare the same buttons as those on the main screen used for selecting different tracksor playing, pausing, stopping, or ejecting the current track. Using MIDI Audio PlayersMIDI (Musical Instrument Digital Interface) files are created from synthesizers andother electronic music devices. They tend to be smaller than other kinds of audiofiles because instead of storing the complete sounds, they contain information aboutthe notes played, tempo and articulation. You can think of a MIDI file as electronicsheet music. The MIDI player reproduces the notes to sound like a huge variety ofMIDI instruments. There are lots of sites on the Internet for downloading MIDI files. Try the Ifni MIDIMusic site (www.ifni.com), for example, which contains songs by the Beatles, LedZeppelin, Nirvana, and others organized by album. Most of the MIDI music is prettysimple, but you can have some fun playing with it. Linux distributions that include the KDE desktop (such as Fedora Core) often comewith the kmid MIDI player. Kmid provides a GUI interface for midi music, includingthe capability to display karaoke lyrics in real time. To start kmid in Fedora, selectSound & Video.KMid (or type kmid &from a Terminal window). Performing Audio File Conversion and CompressionThere are many different formats for storing and compressing speech and musicfiles. Because music files can be large, they are usually stored in a compressed for- mat. While MP3 has been the compression format of choice, Ogg Vorbis is quicklybecoming a favorite for compressing music in the open source community. OggVorbis has the added benefit of not being encumbered by patents as MP3 is.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

476Part IVRunning Applications View file information Click the button in (Web hosting e commerce)

Friday, May 4th, 2007

476Part IVRunning Applications View file information Click the button in the upper-left corner of thescreen to see the XMMS menu. Then select View File Info. You can oftenfind out a lot of information about the file: title, artist, album, comments, and genre. For an Ogg file, you can see specific information about thefileitself, such as the format, bit rate, sample rate, frames, file size, andmore. You can change or add to the tag information and click Save tokeep it. 8.When you are done playing music, click the Stop button to stop the currentsong. Then click the X in the upper-right corner of the display to close thewindow. Special features of the XMMS audio player let you adjust frequencies using a graphicequalizer and gather and play songs using a Playlist Editor. Click the button markedEQ next to the balance bar on the player to open the Equalizer. Using the EqualizerThe Equalizer lets you use slider bars to set different levels to different frequenciesplayed. Bars on the left adjust lower frequencies, and those on the right adjust higherfrequencies. Click the EQ button to open the Equalizer. Here are tasks you can per- form with the Equalizer: .If you like the settings you have for a particular song, you can save them asaPreset. Set each frequency as you like it and click the Preset button. Thenchoose Save.Preset. Type a name for the preset and click OK. .To reload a preset you created earlier, click the Preset button and select Load.Preset. Select the preset you want and click OK. The small window in the center/top of the Equalizer shows the sound wave formedby your settings. You can adjust the Preamp bar on the left to boost different levelsin the set range. Using the Playlist EditorThe Playlist Editor lets you put together a list of audio files that you want to play. You can add and delete files from this list, save them to a file, and use them againlater. Click the PL button in the XMMS window to open the Playlist Editor. The Playlist Editor enables you to: .Add files to the playlist Click the Add button. The Load Files windowappears. Select the directory containing your audio files (it s useful to keepthem all in one place) from the left column. Then either select a file fromtheright column and click Add Selected Files or click Add All Files in theDirectory. Click OK. The selected file or files appear(s) in the playlist. You canalso add music files by dragging them from the Nautilus file manager onto theplaylist window.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision florida web design services

Top ten web hosting - 475Chapter 19Playing Music and VideoFigure 19-5:Play Ogg Vorbis

Friday, May 4th, 2007

475Chapter 19Playing Music and VideoFigure 19-5:Play Ogg Vorbis and other audio files from the XMMS playlist. If XMMS is not able to find a configured sound card, it redirects its output to theDisk Writer plug-in. This causes the files you play to be written to hard disk as WAVfiles. You can get many more audio plug-ins from www.xmms.org. The XMMS audio playercan be used in the following way: 1.Obtain music files by ripping songs from a CD or copying them from the Webso that they are in an accessible directory, or by inserting a music CD in yourCD-ROM drive. (XMMS expects the CD to be accessible from /dev/cdrom.) 2.From the red hat menu, select Sound & Video.Audio Player. The X MultimediaSystem player appears. 3.Click the Eject button. The Load files window appears. 4.If you have inserted a CD, the contents of /mnt/cdromappear in the Filespane. Select the files you want to add to your Playlist and click the AddSelected Files or the Add All Files in Directory button to add all songs fromthe current directory. To add audio files from your file system, browse yourfiles and directories and click the same buttons to add the audio files youwant. Select Close. 5.Click the Play List button (the tiny button marked PL) on the console. APlaylist Editor window appears. 6.Double-click the music file, and it starts to play. 7.With a file selected and playing, here are a few actions you can take: Control play Buttons for controlling play are what you would expectto see on a standalone CD player. From left to right, the buttons letyougo to a previous track, play, pause, stop, go to the next track, andeject the CD. The eject button opens a window, enabling you to load thenext file. Adjust sound Use the left slider bar to adjust the volume. Use the rightslider bar to change the right-to-left balance. Display time Click in the elapsed time area to toggle between elapsedtime and time remaining. Note27_
Note: If you are looking for cheap webhost to host and run your apache application check Vision apache web hosting services

474Part IVRunning ApplicationsFigure 19-4:Rhythmbox playing Internet radio. The (Photo web hosting)

Thursday, May 3rd, 2007

474Part IVRunning ApplicationsFigure 19-4:Rhythmbox playing Internet radio. The site www.di.fmlists a number of free Internet radio channels. Playing Music with XMMS Multimedia PlayerThe XMMS (X Multimedia System) multimedia player provides a graphical interfacefor playing music files in MP3, Ogg Vorbis, WAV, and other audio formats. XMMS hassome nice extras too, including an equalizer, a playlist editor, and the capability toadd more audio plug-ins. One of its greatest attributes is that XMMS is easy to use. If the player looks familiar to you, that s because it is styled after the WindowsWinamp program. Red Hat removed all software that does MP3 encoding or decoding because ofpatent concerns related to MP3 format. Although the XMMS player was designed toplay MP3 files, the XMMS plug-in required to actually decode MP3 is not included. To add MP3 support back into your Red Hat/Fedora Core distribution, you can getand install an MP3 plug-in. One place to get RPM packages that support MP3decoding is http://rpm.livna.org. They are also available from other sources, including www.xmms.organd www.gurulabs.com/downloads.html. Thisissue does not necessarily apply to other Red Hat derived distributions, such asMandrake 10.0. Start the XMMS audio player by selecting Sound & Video.Audio Player or by typ- ing xmmsfrom a Terminal window. Figure 19-5 shows the XMMS audio player withthe associated equalizer (below) and the Playlist Editor (to the right). As noted earlier, you can play several audio file formats. Supported formats include: .MP3 (with added plug-in) .Ogg Vorbis .WAV .AU .CD Audio .CIN MoviesNoteTip27_
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

473Chapter 19Playing Music and VideoFigure 19-2:Defining where you (Photography web hosting)

Thursday, May 3rd, 2007

473Chapter 19Playing Music and VideoFigure 19-2:Defining where you store your music. Figure 19-3:Viewing a music library with Rhythmbox. In addition to playing music files, Rhythmbox can launch Sound Juicer to rip CDs(see the Ripping CDs with Grip section later in the chapter for more on ripping CDaudio). Rhythmbox can also play Internet radio stations. The easiest way to do thisis to find a streaming radio station (you want to look for Shoutcast PLS files, usuallywith a .plsextension). Save the PLS file, and then double-click the file in the Nautilusfile browser. Nautilus comes configured to launch Rhythmbox for playing audio. Figure 19-4 shows Rhythmbox with three Internet radio stations.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services