Lab 13
For this lab, you will take a sound snippit and decode it by playing it in reverse.
Choose from any of the following sample sounds and see what secret message
they might contain. To do this, you will have to make a Java program which
can reverse the order in which a sound is played.
Please right click and "save file as..."
Secret #1
Secret #2
Secret #3
Secret #4
Secret #5
Secret #6
To aide you in creating this Java program, code from Thursday's lecture will be quite beneficial.
In this lab, all main will do is prompt for a sound file to decode, send this sound to a method called "reverseSound()", and then play or explore the sound that is returned.
After you have successfully decoded a sound, please write in your comments section the secret number you chose and what the secret message said. You can of course do more than one if you feel so inclined.
- Main Method: main(String[] args)
- this method should prompt the user for a secret sound
- send this secret sound to reverseSound()
- play or explore the sound returned by reverseSound()
- save the decoded sound onto the computer
- Method: reverseSound():
- this method will be given in the secret sound which was prompted for in main
- You should take the sample at the beginning of the sound and swap it with the sample at the end of the sound until all such pairs have been swapped.
- Be careful not to swap the sound samples twice!
- It should return the reversed sound back to where it was called
- You may call other methods to help reverseSound() if you so desire.
- Other Methods
- You may want to create other methods for reverseSound() to call
- These methods may either return void or return a value - it is up to you
- For example, exchangeValues() from Thursday's lecture is a very useful method to implement in this program. You can either have reverseSound() call this method or integrate something like exchangeValues() into your reverseSound() method.
The final result will be a decoded sound. What secret phrase have you uncovered?
Lab Assignment 13
Due: Monday 12/1/2008 by 11:59 pm (you
can always turn it in early)
Create a Java program that will:
- Contain a comment indicating
- your Name,
- Net-ID,
- Course Name,
- Assignment Name and
- a short description of the assignment
- Contain the main() method that will
- Prompt the user for a secret sound file
- Send this sound file to reverseSound(), and return
- Play (or explore) the sound.
- Prompt the user for a name and save it.
Submittal of the Lab Assignment
- When saving your program, use a meaningful name like Lab13.java.
- You are also to submit the Java file
electronically by
using the UNIX turnin command.
- Please sumbit your Java code you made to decode the sound. Please do
not send your .wav file.
To use the UNIX turnin command to electronically hand-in your
html file using the project name of lab13. To submit the file
Lab13.java for lab13, the turnin command is entered as:
turnin -c cs101 -p lab13 Lab13.java
To verify what you submitted using the turnin command type:
turnin -c cs101 -p lab13 -v