/** * Class for creating a template for a simple Java program * * @author Pat Troy: troy AT uic DOT edu */ // Note the name of the class in the following line MUST // match the name of the file. public class Lect1103b { public static void main (String[] args) { System.out.println("Begin Java Exection"); System.out.println(""); // put your Java Program here String filename = FileChooser.pickAFile(); Sound s = new Sound (filename); System.out.println ("S1 Length: " + s.getLength()); System.out.println ("S1 Sampling Rate: " + s.getSamplingRate()); Sound s2; s2 = modifySound (s); System.out.println ("S2 length: " + s2.getLength()); s2.explore(); System.out.println(""); System.out.println("End Java Exection"); } public static Sound modifySound (Sound s1) { Sound s2; s2 = new Sound (s1.getLength()); SoundSample ssarray1[]; SoundSample ssarray2[]; int value; int i; ssarray1 = s1.getSamples(); ssarray2 = s2.getSamples(); for ( i = 0 ; i < s1.getLength() ; ++i ) { value = ssarray1[i].getValue(); value = value * 2; ssarray2[i].setValue(value); } return s2; } } // end of Template class