CS 140 - Lab 17 Sound Basics

Objectives

  1. Learn the basics of how sounds are represented and manipulated in Java.

Method

Sound Basics

  1. 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.
  2. How many sound samples are in the gettsburg.wav file?
  3. Print out the value of the sound sample at index 55055.
  4. Write a Java statements that calculate's and prints how many seconds a sound file will play for.
  5. 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.
  6. 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
  1. Set to zero. What does it sound like?
  2. Set to 10,000. What does it sound like?
  3. Set to a random integer between -1000 and 1000. What does it sound like?

© Ed Harcourt