Archive for May, 2007

Web hosting unlimited bandwidth - Chapter 20 . Playing Music and Video 529

Tuesday, May 8th, 2007

Chapter 20 . Playing Music and Video 529 Figure 20-7: Generate CD jewel case labels with cdlabelgen and print them with evince. You ll want to edit the cdlabelgen command line to include the title and song names for the CD label and rerun ggv a few times to get the label correct. When you are ready to print the label, click Print All to print the label. Working with TV, Video, and Digital Imaging Getting TV cards, Webcams, and other video devices to play in Linux is still a bit of an adventure. Most manufacturers of TV cards and Webcams are not losing sleep to produce Linux drivers. As a result, most of the drivers that bring video to your Linux desktop have been reverse-engineered (that is, they were created by software engineers who watched what the video device sent and received, rather than seeing the actual code that runs the device). The first and probably biggest trick is to get a TV card or Webcam that is supported in Linux. Once you are getting video output from that device (typically available from /dev/video0), you can try out a couple of applications to begin using it. This section explores the tvtime program for watching television and the GnomeMeeting program for video conferencing.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision ecommerce web hosting services

Web site template - 528 Part IV . Running Applications Songs are

Tuesday, May 8th, 2007

528 Part IV . Running Applications Songs are copied to the hard disk in the format you selected. By default, the files are copied into a subdirectory of $HOME/ogg (such as /home/jake/ogg). The subdirectory is named for the artist and CD. For example, if the user jake were ripping the song called High Life by the artist Mumbo, the directory containing ripped songs would be /home/jake/ogg/mumbo/high_life. Each song file is named for the song (for example, fly_fly_fly.wav). 7. Now you can play any of the files using a player that can play WAV or Ogg files, such as XMMS. Or you can copy the files to a CD using cdrecord. Because the filenames are the song names, they don t appear in the same order as they appear on the CD, so if you want to copy them back to a writable CD in their original order, you may have to type each filename on the cdrecord command line. For example: # cdrecord -v dev=/dev/cdrom -audio fly_fly.wav big_news.wav about_time.wav The Grip window can also be used to play CDs. Use the buttons on the bottom of the display to play or pause, skip ahead or back, stop, and eject the CD. The toggle track display button lets you shrink the size of the display so it takes up less space on the desktop. Click toggle disc editor to see and change title, artist, and track information. Creating CD Labels with cdlabelgen The cdlabelgen command can be used to create tray cards and front cards to fit in CD jewel cases. You gather information about the CD and cdlabelgen produces a PostScript output file that you can send to the printer. The cdlabelgen package also comes with graphics (in /usr/share/cdlabelgen) that you can incorporate into your labels. Here s an example of a cdlabelgen command line that generates a CD label file in PostScript format (type it all on one line or use backslashes, as shown, to put it on multiple lines): cdlabelgen -c Grunge is Gone -s Yep HipHop -i If You Feed Me%Sockin Years%City Road%Platinum and Copper%Fly Fly Fly%Best Man Spins%What A Headache%Stayin Put Feelin%Dreams Do Go Blue%Us%Mildest Schemes -o yep.ps In this example, the title of the CD is indicated by -c Grunge is Gone and the artist by the -s Yep HipHop option. The tracks are entered after the -i option, with each line separated by a % sign. The output file is sent to the file yep.ps with the -o option. To view and print the results, use the evince command like this: $ evince yep.ps The result of this example is shown in Figure 20-7.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services

Personal web server - Chapter 20 . Playing Music and Video 527

Tuesday, May 8th, 2007

Chapter 20 . Playing Music and Video 527 Figure 20-6: Rip and play songs from the Grip window. To rip audio tracks from a CD with grip, do the following: 1. With the Grip window open, insert a music CD into your CD drive. If you have an active connection to the Internet and the CD is known to the CD database, the title, artist, and track information appear in the window. 2. Click each track that you want to rip (that is, copy to your hard disk). A check mark appears in that track s Rip column. 3. Click the Config tab at the top of the page, and then select Encode. 4. You can choose the type of encoder used to compress the music by clicking the Encoder box and selecting an encoder (by default, oggenc compresses files in Ogg Vorbis, assuming that Ogg Vorbis was installed on your Linux distribution). 5. Click the Rip tab at the top of the page. 6. Click one of the following: Rip+Encode This rips the selected songs and (if you left in the default oggenc compression in Step 4) compresses them in Ogg Vorbis format. You need an Ogg Vorbis player to play the songs after they have been ripped in this format (there are many Ogg Vorbis players for Linux). Rip only This rips the selected songs in WAV format. You can use a standard CD player to play these songs. (When I tried this, the same song ripped in WAV was 12 times larger than the Ogg Vorbis file.)
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services

526 Part IV . Running Applications 2. Insert (Web hosting e commerce)

Monday, May 7th, 2007

526 Part IV . Running Applications 2. Insert the music CD into your CD-ROM drive. (If a CD player opens on the desktop, close it.) 3. Extract the music tracks you want by using the cdda2wav command. For example: # cdda2wav -D /dev/cdrom -B This reads all of the music tracks from the CD-ROM drive. The -B option says to output each track to a separate file. By default, the cdda2wav command outputs the files to the WAV audio format. Instead of extracting all songs, you can choose a single track or a range of tracks to extract. For example, to extract tracks 3 through 5, add the -t3+5 option. To extract just track 9, add -t9+9. To extract track 7 through the end of the CD, add -t7. If you have a low-quality CD drive or an imperfect CD, cdda2wav might not be the best ripping tool. You might try cdparanoia -B to extract songs from the CD to hard disk instead. 4. When cdda2wav is done, insert a blank CD into your writable CD drive. 5. Use the cdrecord command to write the music tracks to the CD. For example: # cdrecord -v dev=/dev/cdrom -audio *.wav The options to cdrecord tell the command to create an audio CD (-audio) on the writable CD device located at /dev/cdrom. The cdrecord command writes all .wav files from the current directory. The -v option causes verbose output. 6. If you want to change the order of the tracks, you can type their names in the order you want them written (instead of using *.wav). If your CD writer supports higher speeds, you can use the speed option to double (speed=2) or to quadruple (speed=4) the writing speed. After you have created the music CD, indicate the contents of the CD on its label side. It s now ready to play on any standard music CD player. Ripping CDs with Grip For GNOME users, the Grip window provides a more graphical method of copying music from CDs to your hard disk so that you can play the songs directly from your hard disk or burn them back onto a blank CD. Besides just ripping music, you can also compress each song as you extract it from the CD. You can open Grip from the red hat menu by selecting Sound & Video.Grip (or by typing grip from a Terminal window). Figure 20-6 shows an example of the Grip window. Note
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

Web design company - Chapter 20 . Playing Music and Video 525

Monday, May 7th, 2007

Chapter 20 . Playing Music and Video 525 If you re are interested in making a CD jukebox that rips, records, and compresses music CDs using oggenc and other open source software, check out Linux Toys by Christopher Negus and Chuck Wolber from Wiley Publishing (2003). Recording and Ripping Music Writable CD-ROM drives are a standard device on computers. Where once you had to settle for a floppy disk (1.44MB) or a Zip disk (100MB) to store personal data, a CD-ROM burner lets you store more than 600MB of data in a format that can be exchanged 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 cdrecord command enables you to create audio and data CDs from the command line, writing to CD-recordable (CD-R) and CD-rewritable (CD-RW) drives. This command is discussed in the following section. Creating an Audio CD with cdrecord You can use the cdrecord command to create either data or music CDs. You can create a data CD by setting up a separate file system and copying the whole image of that file system to CD. Creating an audio CD consists of selecting the audio tracks you want to copy and copying them all at once to the CD. This section focuses on using cdrecord to create audio CDs. cdrecord can use audio files in .au, .wav, and .cdr formats, automatically translating them when necessary. If you have audio files in other formats, you can convert them to one of the supported formats by using the sox command (described previously in this chapter). One way to create an audio CD is to use cdda2wav to extract (copy) the music tracks to a directory and then use cdrecord to 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 to Appendix A, which describes how to use the K3B CD Kreator for burning CD images. That tool can also be used for copying audio CDs. 1. Create a directory to hold the audio files, and change to that directory. (Make sure the directory can hold up to 660MB of data less if you are burning fewer songs.) For example: # mkdir /tmp/cd # cd /tmp/cd Note
Note: If you are looking for high quality webhost to host and run your jsp application check Vision christian web host services

Vps web hosting - 524 Part IV . Running Applications To see

Monday, May 7th, 2007

524 Part IV . Running Applications To see what SoX is doing, use the -V option. For example: $ sox -V file1.wav file1.voc sox: Reading Wave file: Microsoft PCM format, 2 channel, 44100 samp/sec sox: 176400 byte/sec, 4 block align, 16 bits/samp, 50266944 data bytes sox: Input file: using sample rate 11025 size bytes, style unsigned, 1 channel sox: Input file1.wav: comment file1.wav sox: Output file1.voc: using sample rate 44100 size shorts, encoding signed (2 s complement), 2 channels sox: Output file: comment file1.wav You can apply sound effects during the SoX conversion process. The following example shows how to change the sample rate (using the -r option) from 10,000 KHz to 5,000 KHz: $ sox -r 10000 file1.wav -r 5000 file1.voc To reduce the noise, you can send the file through a low-pass filter. Here s an example: $ sox file1.voc file2.voc lowp 2200 For more information on SoX and to get the latest download, go to the SoX Sound eXchange home page (www.sourceforge.net/projects/sox/). Compressing Music Files with oggenc The oggenc command takes music or other audio data and converts it from uncompressed 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 noticeable loss of sound quality. (I used the default settings in oggenc and reduced a 48MB WAV music file to 4MB.) In its most basic form, you can use oggenc with one or more WAV or AIFF files following it. For example: $ oggenc *.wav This command would result in all files ending with .wav in the current directory to be converted to Ogg Vorbis format. An OGG file is produced for each WAV file, with oggenc substituting .ogg for .wav as the file suffix for the compressed file. Ogg Vorbis files can be played in many different audio players in Linux, including the XMMS player (described earlier). If you want to rip music files from a CD and compress them, you can use the Grip window (described later in this chapter). Grip enables you to select oggenc as the tool to do the file compression. Tip
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

Chapter 20 . Playing Music and Video 523 (Com web hosting)

Sunday, May 6th, 2007

Chapter 20 . Playing Music and Video 523 File Extension File Extension or Pseudonym Description or Pseudonym Description .prc Psion record.app format, .sf IRCAM sound files, newer than the WVE used by CSound format. package and MixView sample editor. .sph Speech audio SPHERE .smp SampleVision files (Speech Header from Turtle Beach, Resources) format from used to communicate NIST (National Institute with different MIDI of Standards and samplers. Technology). .sunau Pseudo file, used to .txw Yamaha TX-16W from open a /dev/audiofile a Yamaha sampling and set it to use the keyboard. data type being passed to SoX. .vms Used to compress .voc Sound Blaster VOC speech audio for voice file. mail and similar applications. .wav Microsoft WAV RIFF .wve 8-bit, a-law, 8 KHz files. This is the native sound files used with Microsoft Windows Psion Palmtop sound format. computers. .raw Raw files (contain no .ub, .sb, .uw, Raw files with set header information, so .sw, .ul, .al, characteristics. ub is sample rate, size, and .lu, .la, .sl unsigned byte; sb is style must be given). signed byte; uw is unsigned word; sw is signed word; and ul is ulaw. If you are not sure about the format of an audio file, you can add the .auto extension to the filename. This triggers SoX to guess what kind of audio format is contained in the file. The .auto extension can be used only for the input file. If SoX can figure out the content of the input file, it translates the contents to the sound type for the output file you request. In its most basic form, you can convert one file format (such as a WAV file) to another format (such as an AU file) as follows: $ sox file1.wav file1.au
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

522 Part IV . Running Applications Table 20-1 (Personal web server)

Sunday, May 6th, 2007

522 Part IV . Running Applications Table 20-1 Sound Formats Supported by the SoX Utility File Extension File Extension or Pseudonym Description or Pseudonym Description .8svx 8SVX Amiga musical .aiff Apple IIc/IIgs and instrument description SGI AIFF files. May format. require a separate archiver to work with these files. .au,.snd Sun Microsystems AU .avr Audio Visual audio files. This was once Research format, a popular format. (The used on the Mac. .snd extension is ambiguous because it s also been used on NeXT format and headerless Mac/PC format.) .cdr CD-R files used to master .cvs Continuously compact disks. variable slope delta modulation, which is used for voice mail and other speech compression. .dat Text data files, which .gsm Lossy Speech contain a text Compression (GSM representation of 06.10), used to shrink sound data. audio data in voice mail and similar applications. .hcom Macintosh HCOM files. .maud Amiga format used to produce sound that is 8-bit linear, 16-bit linear, A-law, and ulaw in mono or stereo. .ogg Ogg Vorbis compressed .ossdsp Pseudo file, used to audio, which is best used open the OSS for compressing music /dev/dsp file and and streaming audio. configure it to use the data type passed to SoX. Used to either play or record.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services

Web hosting asp - Chapter 20 . Playing Music and Video 521

Sunday, May 6th, 2007

Chapter 20 . Playing Music and Video 521 Using MIDI Audio Players MIDI (Musical Instrument Digital Interface) files are created from synthesizers and other electronic music devices. They tend to be smaller than other kinds of audio files because instead of storing the complete sounds, they contain information about the notes played, tempo and articulation. You can think of a MIDI file as electronic sheet music. The MIDI player reproduces the notes to sound like a huge variety of MIDI instruments. There are lots of sites on the Internet for downloading MIDI files. Try the Ifni MIDI Music site (www.ifni.com), for example, which contains songs by the Beatles, Led Zeppelin, Nirvana, and others organized by album. Most of the MIDI music is pretty simple, but you can have some fun playing with it. Linux distributions that include the KDE desktop (such as Fedora Core) often come with the kmid MIDI player. Kmid provides a GUI interface for midi music, including the capability to display karaoke lyrics in real time. To start kmid in Fedora, select Sound & Video.KMid (or type kmid & from a Terminal window). Performing Audio File Conversion and Compression There are many different formats for storing and compressing speech and music files. Because music files can be large, they are usually stored in a compressed format. While MP3 has been the compression format of choice, Ogg Vorbis is quickly becoming a favorite for compressing music in the open source community. Ogg Vorbis has the added benefit of not being encumbered by patents as MP3 is. Tools that come with Fedora Core for converting and compressing audio files include: . sox (SoX) A general-purpose tool for converting audio files among a variety of formats. . oggenc A tool for specifically converting music files to Ogg Vorbis format. Converting Audio Files with SoX If you have a sound file in one format, but you want it to be in another format, Linux offers some conversion tools. The SoX utility can translate to and from any of the audio formats listed in Table 20-1. Type sox -h to see the supported audio types, as well as supported options and effects. Tip
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services

Shared web hosting - 520 Part IV . Running Applications The small

Sunday, May 6th, 2007

520 Part IV . Running Applications The small window in the center/top of the Equalizer shows the sound wave formed by your settings. You can adjust the Preamp bar on the left to boost different levels in the set range. Using the Playlist Editor The 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 again later. 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 window appears. Select the directory containing your audio files (it s useful to keep them all in one place) from the left column. Then either select a file from the right column and click Add Selected Files or click Add All Files in the Directory. Click OK. The selected file or files appear(s) in the playlist. You can also add music files by dragging them from the Nautilus file manager onto the playlist window. . Select files to play To select from the files in the playlist, use the previous track and next track buttons in the main XMMS window. The selected file is highlighted. Click the Play button to play that file. Alternatively, you can double-click any file in the playlist to start it playing. . Delete files from the playlist To remove files from the playlist, select the file or files you want to remove (use the next track and previous track buttons), right-click the playlist window, and click Remove.Selected. The selected files are removed. . Save the playlist To save the current playlist, hold the right mouse button down on the List button and then select Playlist.Save List from the pop-up menu. Browse to the directory you want, and then type the name you want to assign to the playlist and click OK. The filename should end with an .m3u extension, such as monkees_hits.m3u. . Load the playlist To reload a saved playlist, click the List button. Select a playlist 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. These are the same buttons as those on the main screen used for selecting different tracks or playing, pausing, stopping, or ejecting the current track.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services