CS 140 - Lab 17 Sound Basics
Objectives
-
Learn the basics of how sounds are represented and manipulated in Java.
Method
Sound Basics
-
Create a
Lab17
program class that plays the sound
in file gettysburg.wav
. This file is located in the
folder T:/Harcourt/Spring2008/cs140/sounds
.
-
How many sound samples are in the
gettsburg.wav
file?
-
Print out the value of the sound sample at index 55055.
-
Write a Java statements that calculate's and prints how many seconds a sound file will play for.
-
Decrease the volume of the wave file by multiplying each sample by a number
less than one. Try multiplying by 0.75 and 0.05. What is the difference.
-
What happens if you double each sound sample (make it bigger, not smaller). Explain
what happens when you multiply each sound sample by ten.
Extra Credit
Modify the Gettysburg sound file so that every other sound sample value is
- Set to zero. What does it sound like?
- Set to 10,000. What does it sound like?
- Set to a random integer between -1000 and 1000. What does it sound like?
© Ed Harcourt