/** * Double the volume of a sound file * * @author Pat Troy: troy AT uic DOT edu */ import java.util.*; import java.awt.*; import java.io.*; public class Lect331b { public static void main(String[] args) { // Prompt the user for a file and open it as a sound file String fileName = FileChooser.pickAFile(); Sound s1 = new Sound (fileName); int x = 0; // loop for all samples in the sound file while (x < s1.getLength()) { // get the numeric value at the sample int samp = s1.getSampleValueAt (x); // double the value of the sample (doubling the volume) samp = samp * 2; // place the new value back into the sample s1.setSampleValueAt(x, samp); // increment the value to get the next sample x++; } //System.out.println (s1.getSampleValueAt (10000)); System.out.println("Before Play"); //s1.play(); s1.explore(); System.out.println("After Play"); } }