Archive for April, 2007

Chapter 20 . Playing (Web hosting comparison) Music and Video 531

Friday, April 20th, 2007

Chapter 20 . Playing Music and Video 531 card is not being properly detected, find your card in the CARDLIST files. Then add the appropriate line to the /etc/modprobe.conf file. For example, to add a Prolink PV-BT878P, revision 9B card, add the following line to the file: options bttv card=72 . You can also add other options listed in the Insmod-options file for the bttv driver. If you are still having problems getting your card to work, a mailing list is available on which you can ask questions about Video4Linux issues: http://listman.redhat.com/mailman/listinfo/video4linux-list. While this list is for Red Hat specifically, the information is germane to most distributions. One possible reason that you don t see any video when you try to run tvtime or other video applications is that some other person or video application already has the video driver open. Only one application can use the video driver at a time. Another quirk of video4linux is that the first person to open the device on your system becomes the owner. So you might need to open the permissions of the driver to allow people other than the first person to use it to access the video4linux driver. Running Tvtime To start up the tvtime viewer, simply select TVtime Televison Viewer from the Sound & Video or Multimedia menu (depending on your Linux distribution), or type the following from a Terminal window on your desktop: $ tvtime & A video screen should appear in a window on the desktop. Click on the window to see a list of stations. Right-click to see the onscreen Setup menu. Here are a few things you can now do with your tvtime onscreen display: . Configure input Change the video source, choose the television standard (which defaults to NTSC for the U.S.), and change the resolution of the input. . Set up the picture Adjust the brightness, contrast, color, and hue. . Adjust the video processing Control the attempted frame rate, configure the deinterlacer, or add an input filter. . Adjust output Control the aspect ratio (for 16:9 output, for example), apply a matte, or set the overscan mode. Video Conferencing with GnomeMeeting The GnomeMeeting window lets you communicate with other people over a network through video, audio, and typed messages. Because GnomeMeeting supports the H323 protocol (a standard for multimedia communications), you can use it to
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services

530 Part IV . Running Applications Watching (Com web hosting) TV

Friday, April 20th, 2007

530 Part IV . Running Applications Watching TV with Tvtime The tvtime program (tvtime command) enables you to display video output television channels, in particular on your desktop. You can change the channels, adjust volume, and fine-tune your picture. In addition, tvtime sports a slick onscreen display and support for a widescreen display. Tvtime will not display output from some low-quality Webcams. To use your Webcam, consider obtaining the xawtv package, which is available for most Linux distributions. The following sections describe how to choose a TV capture card and use tvtime to watch television on your desktop. Getting a Supported TV Card Video4Linux (V4l/V4l2) is the video interface available for Linux. It supports a variety of TV capture cards and cameras, and is included in some distributions. If your distribution does not include V4l or V4L2, you can install it on your own, although it is not the easiest task to accomplish. For more information about obtaining and installing V4l and the appropriate driver, visit http://linux.bytesex.org/v4l2/ index.html. To see a list of supported TV cards that you can use with tvtime, refer to the CARDLIST and Cards files of your V4l installation. To view these files, you need to have the kernel-source package installed. You ll find the Cards file in /usr/src/ linux*/Documentation/video4linux/bttv/Cards on your Linux system. The Cards file applies to the Video4Linux bttv driver. In addition, look at all files starting with CARDLIST in /usr/src/linux*/Documentation/video4linux/CARDLIST*. Video4Linux is designed to autodetect your TV capture card and load the proper modules to activate it. Install the TV-card hardware (with the appropriate connection to your TV reception), boot Linux, and run the tvtime command as described in the next section. You should see video displayed on your tvtime window. If your card doesn t appear to be working, here are a few things you can try: . Check that your TV card was properly seated in its slot and detected by Linux by typing: $ /sbin/lspci This shows you a list of all valid PCI cards on your computer. If your card doesn t show up, you probably have a hardware problem. . It is possible that the card is there but that the right card type is not being detected. Improper detection is most likely if you have a card for which there are several revisions, with each requiring a different driver. If you think your Note
Note: If you are looking for high quality webhost to host and run your jsp application check Vision florida web design services

Chapter 20 . Playing Music and (1 on 1 web hosting) Video 529

Thursday, April 19th, 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 and reliable webhost to host and run your j2ee application check Vision best web hosting services

528 Part IV . Running Applications Songs are

Thursday, April 19th, 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 cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

Chapter 20 . Playing Music and Video 527 (Web and email hosting)

Thursday, April 19th, 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: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services

526 Part IV . Running Applications 2. Insert (Web site traffic)

Wednesday, April 18th, 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: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

Chapter 20 . Playing Music and Video 525 (Adult web hosting)

Wednesday, April 18th, 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: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services

Apache web server for windows - 524 Part IV . Running Applications To see

Tuesday, April 17th, 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 virtual web hosting services

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

Tuesday, April 17th, 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 cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

Kids web site - 522 Part IV . Running Applications Table 20-1

Monday, April 16th, 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 webhost to host and run your web application check Vision cheap hosting services