========================= QUICK EXERCISE: "posterize" a sound > Sound s = new Sound( "/Users/wallingf/Desktop/dratcomp.wav" ); > s.play(); > s.toThreeValues(); > s.play(); > s = new Sound( "/Users/wallingf/Desktop/dratcomp.wav" ); > s.play(); > s.toThreeValuesAlternate(); > s.play(); ========================= DISCUSS: ComicStrip for Homework 4 ========================= TASK: creating a sound clip > Sound s = new Sound( "/Users/wallingf/Desktop/the-voice-raw.mp3" ); Unable to read from file /Users/wallingf/Desktop/the-voice-raw.mp3. The file type is unsupported. Are you sure you're using a WAV, AU, or AIFF file (some .wav files are encoded using mp3)? Try using SimpleSound.convert(String oldName, String newName) and then try to read the new name. javax.sound.sampled.UnsupportedAudioFileException: ... > s = new Sound( "/Users/wallingf/Desktop/the-voice-raw.aiff" ); > s.play() > s.explore() > 101750 - 34750 67000 > Sound sNew = new Sound( 67000 ) > for (int i = 0; i < 67000; i++ ) { sNew.setSampleValueAt( i, s.getSampleValueAt( i + 34750 ) ); } > sNew.play() > sNew.explore(); ----- what went wrong?? ----- ... incorrect frequency... > sNew.getSamplingRate() 22050.0 > s.getSamplingRate() 16000.0 > sNew.playAtRateDur( 16000/22050.0, sNew.getLength() ) ----- we have changed the amplitude of a sound wave. ----- how can we change the frequency??? > sNew.write( "/Users/wallingf/Desktop/the-voice-clipped-and-pitched.aiff" ); ----- look at the generic clip method ----- clip out "the voice" > s = new Sound( "/Users/wallingf/Desktop/the-voice-raw.aiff" ); > s.explore(); ----- 64367..77737 -- second group of sounds > Sound theVoice = s.clip( 64367, 77737 ); > theVoice.play(); > theVoice.playAtRateDur( 16000/22050.0, theVoice.getLength() ); ========================= TASK: increase/decrease volumes > s = new Sound( "/Users/wallingf/Desktop/fogleg50.wav" ); > s.play(); > s.increaseAndDecrease(); > s.play(); ----- why two for loops, and not just one?? > s = new Sound( "/Users/wallingf/Desktop/fogleg50.wav" ); > s.increaseAndDecreaseV2(); > s.play(); ========================= EXERCISE: linear rise/fall of volume s = new Sound( "/Users/wallingf/Desktop/fogleg20.wav" ); > s.explore(); > s.play(); > s.riseAndFall(); > s.explore(); > s.play();