Question
/** * Class that represents a sound. This class is used by the students * to extend the capabilities of SimpleSound. * * Copyright Georgia
/** * Class that represents a sound. This class is used by the students * to extend the capabilities of SimpleSound. * * Copyright Georgia Institute of Technology 2004 * @author Barbara Ericson ericson@cc.gatech.edu */ public class Sound extends SimpleSound { /////////////// consructors //////////////////////////////////// /** * Constructor that takes a file name * @param fileName the name of the file to read the sound from */ public Sound(String fileName) { // let the parent class handle setting the file name super(fileName); } /** * Constructor that takes the number of seconds that this * sound will have * @param numSeconds the number of seconds desired */ public Sound (int numSeconds) { // let the parent class handle this super(numSeconds); } /** * Constructor that takes a sound to copy */ public Sound (Sound copySound) { // let the parent class handle this super(copySound); } ////////////////// methods //////////////////////////////////// /** * Method to return the string representation of this sound * @return a string with information about this sound */ public String toString() { String output = "Sound"; String fileName = getFileName(); // if there is a file name then add that to the output if (fileName != null) output = output + " file: " + fileName; // add the length in frames output = output + " number of samples: " + getLengthInFrames(); return output; } } // end of class Sound, put all new methods before this
Add a static main method to the Sound class, and inject code into it that demonstrates the operation of the methods that you subsequently add to the Sound class, as specified below. Add the increaseVolume method, but write it such that it uses a for-each loop. Add a halvePosDoubleNeg method that halves the volume of positive values and doubles the volume of negative values Make an audio collage. Make it at least five seconds long, and include at least two different sounds (e.g., sounds from different files). Make a copy of one of those different sounds and mirror it. Splice together the original two sounds and the modified sound to make the complete audio collage. Your program should write the collage file out to the disk. Submit the Sound.java file, along with the sound files used and collage sound file created. Submit these files together as a single zipped attachment. Please use the zip format (not .rar or any other format).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started