Lab 7: Sound and Multimedia representations

Fri Nov 2 14:43:13 EST 2001

By the end of this lab, you will be able to:

In this lab we explore the manipulation of sound -- the other half of audio-visual media (we did graphics in Lab 6). Sound is an integral part of many web pages; using the appropriate tools, you can turn your web site into a true multimedia experience.

In this lab we also take time to explore how the amount of data saved affects the quality of a sound, and study the different qualities of sound available and the amount of storage required when using the different alternatives.

If you do not have GoldWave on your machine, you can download it from the GoldWave web site; a local copy is also available. GoldWave is shareware; if you decide to keep it, you should pay for it.

Part 1: Using Windows Sound Programs
Part 2: Music on the Internet
Part 3: GoldWave
Part 4: Finishing up and shutting down

Part 1 : Using Windows Sound Programs

CD Player

Windows comes with many applications programs. You have been using some of them, like Notepad, throughout this semester. In this section, we'll be looking at the various programs that come with Windows dealing with sound. They are all relatively basic, most of them only performing one main function. Later in this lab, we will look at a more advanced sound program, GoldWave. Remember: any programs you read about in this section of the lab will be available on any computer with Windows 95, 98, NT, etc. GoldWave is one example of the many additional programs you can obtain to manipulate sound files.

The first Windows program we will be considering is the CD Player. You can open the CD Player by clicking on the Start button, moving the mouse up to the Programs option, then moving it up to the Accessories option. From there, select Entertainment, and finally, CD Player.

You will recognize many of the buttons in this window as imitations of a real CD player control panel. If you leave the mouse on a button, a help label with the function will appear after a second or two. Before continuing, make sure your headphones are plugged into the correct jack on the back of the cluster computers. Don't plug your headphones in on the front (near the CD opening). You want the green jack towards the middle of the group of jacks at the bottom right of the machine (facing the back of the machine.) If you have any difficulty, ask a TA for help.

Once your headphones are secured, press the long button on the right side of the CD-ROM drive in the front of your computer. A little tray will slide out. Gently remove the CD you brought from its case, and lay it on the tray. DO NOT push the tray back in. This will damage the motor mechanism on the drive. Instead, press the button again and the tray will retract automatically. Once the tray is closed, you are ready to start listening to your CD.

What, no sound? You're playing a CD, the headphones are plugged in right, but you hear nothing? Be sure both volume controls are turned up: the thumbwheel under the CD opening, and the software volume control doodad. Again, ask a TA for help if you can't get any sound.

You will notice that by clicking on the large rectangle at the left side of the CD player Window, you will be able to make it display any of the following information:

This CD player is pretty simple to operate. Its other main feature is that you can select which songs you would like to have played through the "Play List" -- similar to the "memory" on actual CD players. The Play List determines the order that the tracks on your CD will be played. The computer stores a separate Play List for each CD. It even remembers the Play List for a particular CD, even after you remove it!

To customize your Play List, simply go to the Disc Menu, and select "Edit Play List." The first two fields in the window, Artist and CD, allow you to fill in this information for the CD in the drive. There is no reason for filling in those slots for this lab. The left hand column, labeled "Play List," is the order that the tracks on your CD will be played in. The right hand column, labeled "Available Tracks," is simply every track on the CD in numerical order. If there is a song on your CD that you do not like, simply click on its track number in the Play List, and then click on the "Remove" button. It disappears from the Play List, and the CD will not play it! But wait, there's more!

Let's create a Play List from scratch! Simply click on "Clear All," and all the tracks in the Play List disappear! Now, you can choose, from the Available Tracks column, which tracks you want to listen to, and the order in which they should be played. So, if your favorite track happens to be the last one on the CD, after clearing the Play List, simply click on that track number in the Available Track list, click on "Add", and it becomes the first track on the Play List! Even better, you can have it play the same song as many times as you want! Simply Add the same track to the Play List as many times as you'd like to hear it.

Sound Recorder

Notice: The Sound Recorder sometimes goes missing from some of the cluster computers for no apparent reason. If you encounter this problem, please notify a lab assistant and read this note for a work-around. Sorry.

Now that you have learned how to use the CD Player, we will show you how to record sounds from your CD so that you can include them in your web site! We will use the "Sound Recorder" accessory. The Sound Recorder is able to record any sounds from a microphone or the CD player. (If you own a microphone, you may bring it in and attach it to the back of the computer to record yourself.) The Sound Recorder lets you change the sound quality of a recording, and produce some limited effects. Click on the Start button, move the mouse up to Programs, and then up to Accessories. In the window that pops up, select Multimedia, and finally Sound Recorder.

We will begin by recording from the CD Player. Without closing Sound Recorder, open CD Player if it is not already opened. Now, select a song that you like. After hitting the play button on the CD Player, click on the Record button on the Sound Recorder (the right most button with the circle on it). The computer is now recording the music off of the CD. You'll notice sound waves appearing in the Sound Recorder window. To stop recording, hit the stop button (the button with the square on it, adjacent to the record button). You can hit the record button anywhere in the song that you'd like. In addition, to record certain sections of the song, you can hit the Stop button on the Sound Recorder to pause recording, and then the Record button again to continue the recording when the CD arrives at the point at which you wish to continue the recording.

After stopping the CD Player, hit the Rewind button on the Sound Recorder, and then the Play button, to play back what you have recorded. If you are not pleased with what was recorded, simply select the File menu and New to start a new recording; the last recording will not be saved. To save a recording, go to the File menu, and select Save As. The sound file is growing at about 21.5 kilobytes per second (KB/sec), so keep your recordings to a minute or less. Remember to save to your network drive for permanent storage. We will ask you to put a sound on an HTML page. Remember that the files for any sounds that you want accessible from your Web site must be in your public_html directory. But also remember that your directory has a limited quota, so watch out for extra-long recordings and extra-big files. Your trusty TA can help if you have concerns about this.

Sound quality and file size

The sample rate (how many times per second the sound waves are sampled to make the digital representation), the number of bits per sample, and whether it is a mono or stereo sample determine the quality of a sound recording and the size of the file created to store the sound. By default, the Sound Recorder recorded it in "Radio Quality." Radio quality is a mono recording using 8 bits per sample and 22050 samples per second, giving files that grow about 21.5 KB/sec. Other choices are "Telephone Quality" and "CD Quality". Telephone quality is even poorer and more compact: a mono recording using 8 bits per sample and 11025 samples per second, giving files that grow about 11KB/sec. CD Quality is much better and more space consuming: a stereo recording using 16 bits per sample and 44100 samples per second, giving files that grow about 172KB/sec (8 times that of Radio Quality).

To change the recording quality, go to the "Edit" menu of Sound Recorder and select "Audio Properties". The window that opens has a Playback section and a Recording section. From the Recording section, open the drop down menu labeled "Preferred Quality" and select the quality you want. Click on "Apply" and then "OK" at the bottom. The window will close. Then go to the "File" menu and select "New". The new quality will be used for recording the new file. (In Windows 2000, this may be under File | Properties". Click on the drop-down menu, select "Recording Quality", then click on "Convert Now". Then under Sound Selection, click on the new drop-down menu to select the CD / Telephone / Radio choices.) Note that once you have recorded a file using a particular quality, you must choose "Properies" under the "File" menu to change the quality for that file, even if you want to completely record over the contents of the file.

Choose a 10-second segment of your CD to record. When judging sound quality, differences are often more noticeable on songs than on a voice, so take this into account in your selection. Make three recordings of this segment: one in each of the three qualities and save these in three files. Listen to the recordings. Can you hear the difference? Look at the file sizes: you can certainly see the difference. You will submit the files for the recording in Radio Quality and the recording in Telephone Quality. Save the file for the recording in CD Quality for now, since we'll be using it later; but you won't be submitting it, since it is large.

Please read this note on copyright law and university policy

Virtually all CDs that are sold commercially are copyrighted. This means that it is generally illegal for you to distribute copies of songs from your CDs. (Making a copy of a song for your own personal, noncommercial use generally qualifies as "fair use" and therefore is allowed.)

University policy also requires you to obey copyright laws when using the university's computers.

Media Player

The media player allows you to play back files that you have already saved without opening Sound Recorder. Start the Media Player by selecting it from the same place where you found CD Player and Sound Recorder. From the File menu, select Open, and then choose one of the sound files you have saved. Once the file is loaded, hit the play button on the far left to listen to it. You should recognize the stop, fast-forward, and rewind buttons from the CD player.


Part 2: Music on the Internet

Music in MP3 Format

The sound files we've seen so far have to be quite large in order to give you good sound quality. It would be impractical to transfer such large files over the Internet. Fortunately, audio experts have designed a more efficient format known as "MP3". MP3 uses a perceptual compression method, which means that it makes audio files smaller by discarding information that is not noticed (at least, not much) by the human ear.

There are many sources of MP3 files on the Internet; some of them offer illegal copies of copyrighted songs. One good source of legal MP3 files is www.mp3.com. Go there and browse around a bit until you find a song you like.

Go to the page for one of the featured bands, then click through to the "download page". This page will give you several options for how to get the music for a song.

Note that the first two options do not make a copy of the music on your PC, but merely transmit the song across the Internet and play it as it arrives at your PC. Only the last option actually makes a copy of the song on your PC. No matter what, there's no need for you to provide them with an accurate email address if you don't want to.

Listen to the song you chose on both "Lo Fi Play" and "Hi Fi Play". Compare the sound quality of those two choices against the sound quality of the three files you saved earlier in this lab session. (This is obviously a judgement call on your part, so there is not necessarily a single right answer.) Rank the five recordings from best quality to worst quality.

Now look at the quality vs. size tradeoff. The "Hi Fi" MP3 falls between the recorder's Telephone Quality and Radio Quality in terms of the number of bytes used per second of music; but for most people, the "Hi Fi" MP3 sounds much better. The reason is that the MP3 format is much more clever about what information it throws away when it's trying to make the file small.

Internet Radio

The two "Play" options on mp3.com are examples of "streaming audio". This means that rather than downloading a file onto your PC and then listening to it, your software listened to the file while it was arriving. This saves space on your hard drive, since you don't have to store the song there, and it allows you to start listening to the music almost immediately, rather than waiting for the whole song to download.

Radio stations also using streaming audio technology to broadcast their signals over the Internet. Many radio stations broadcast the same programs over the Internet as over the airwaves, but there are a few stations that broadcast only on the Internet.

There is a good search engine for Internet radio stations at realguide.real.com. Go there, and browse around, listening to a few stations from whatever places catch your fancy. Look for stations from faraway places. What's the most exotic place where you can find a working station?


Part 3: GoldWave

Links to Interesting Sounds

GoldWave is an elaborate applications program that incorporates all of the features of the programs which come with Windows NT, but is able to produce even more special effects. In order for you to get the full experience from this lab, you should download (i.e. copy from another site) a few different sounds that you find interesting. Here are some Web sites you might want to try (but feel free to find others):

If you have forgotten how to download sound files from the Web, please review Part 5 of Lab 2. GoldWave handles a variety of sound formats, with Wave (.wav) as the most common.

Features of GoldWave

Now that you've found some sounds, let's take a look at GoldWave. You will find GoldWave under "Cluster Applications". You'll notice that the program is comprised of two windows - the main program window, and the device controls.

Device Controls - this is the standard CD-type control setup we have been working with.

Main GoldWave window - this is where we select different parts of our sound file to perform various special effects on.

Take a moment to become familiar with the main window in GoldWave. Notice that when you drag the mouse across the sound wave (which should be a flat line right now), it highlights it. This is how you will select areas of your recording to use special effects on. Now, look in the effects menu. Most of the options there are relatively intuitive. If you select an effect without first highlighting some of the sound bar, then it will automatically affect the entire recording. Finally, notice the buttons right underneath the View and Tools menus. These are perhaps the most important buttons in the program. The Undo button will allow you to undo the effects of a menu choice, but you can only go back one step. You can cut and paste highlighted segments of your sound file, just as you would a normal text file. These allow you to reposition various parts of your song!

Load your sound file into GoldWave (select Open from the File menu). Familiarize yourself with the Device Controls, then experiment!

A few other important features you should be aware of:

Most of the others are self-explanatory. Remember: this lab is supposed to be fun for you. Be creative and experiment!

Create a 20-second sound file using GoldWave Features, and save this file for submission. Your file should have at least two obviously different sources spliced together and one or more of GoldWave's effects. Your file should not be any larger than about 500KB, which means you should start with no better than a Radio Quality recording or a sound file from the Web of comparable size.


Finishing up and shutting down

Submitting your work

This week we'd like you to place each of the sound files that we asked you to save in your public_html directory and create a new HTML file (not your home page) with links to these sounds. Call this file soundlab.html

Recall that sound links are created by typing

replacing "filename.wav" with the name of the desired file. We would also like you to put in the HTML file soundlab.html some text to explain what you have done.

These are the files to which you should have links and the explanations you should include in the HTML file:

Here's a template that you should use to help create your HTML file for submission. Send email to cs109@princeton.edu or cs111@princeton.edu with the URL (http://www.princeton.edu/~yourname/soundlab.html) of the HTML file, and subject "Lab 7 -- Your name".

Transferring saved work

If you saved anything on the Desktop, be sure to transfer it to your public_html folder on arizona. And make sure the files are readable: we can't grade it if we can't read it.

If you've completed the lab, sent your email to cs109@princeton.edu or cs111@princeton.edu and transferred your work to your Unix account, then you are finished.