CS 101 - Introduction to Computing, Fall 2008

Lab 11

THis lab will have you combine two sound files to add a "background" soundtrack to a foreground sound. The following files of the Gettysburg Address and the Preamble of the U.S. Constitution are great foreground sound files.

To combine two sound files, you simply just add the sample values together. The only problem occurs if the resulting value goes above 32,767 or below -32,768. A simple solution is to use an if statement to check for this. Two simple if statements can check for this and correct the problem if it occurs. To correct this, just set the value to either 32,767 if the value was greater than 32,767 or set the value to -32768. if the value was less than -32,768.

The functions of

are useful for getting the sample values.

Lab Assignment 11

Due: Thursday 11/13/2008 by 11:59 pm

Create a Java program that will:

  1. Contain a comment indicating

  2. Contain the main() method that will Here are some example sound files you can use with this assignment.

    Submittal of the Lab Assignment