Objectives:
| Assignment: Write a method public Sound taperEnd(int num) which returns a new sound that is the same as the calling sound except that the last num samples taper off to zero volume at a constant rate. Hint: Consider the ration (num-i) / num. When i is 0 this ratio will be 1 and when i is num it will be 0. If we have a loop with i ranging from 0 to num we will get the desired taper value factor from this ratio. The index into the array is not i so you will need to figure out what index you will need. |
We can combine two sounds together simply by adding their values.
| Assignment: Write a method public Sound add(int start, Sound overlaySound) which creates a new sound of the appropriate length. It contains all parts of both sounds. The calling sound is copied to the new sound and then starting at the sample indicated by start, the overlaySound will also be played (both at the same time). If the overlay sound extends beyond the length of the calling sound, then be sure your combined sound is long enough. |
| Assignment: Write a method public Sound stutter(int start, int end, int numRepeats) which creates a new sound that is the same as the calling sound except that the portion of the calling sound between start and end (inclusive) is now repeated numRepeats times. |
| Assignment: Write a program Audio which creates an audio collage. Your collage should contain multiple sounds that are transformed in several different ways. You may use the methods we wrote here, those which are contained in the text, or any others that you devise. The result of the program should be a single audio file containing your collage. |