PDA

View Full Version : Making sound in JAVA


SuchitL
12-20-2003, 09:34 AM
Hey everybody,
I've got a wierd idea and I want to try it out in Java. This is not for the FIRST competetion, but just for fun.

I have heard that in Java, we can produce any sound with a given frequency. Can somebody help me out with this. I want to try it out. I want to make an instrument in which we can press different keys to produce different sounds.

Thanks, in advance.

Alfred Thompson
12-29-2003, 02:24 PM
Look into the Javax.sound classes.

sevisehda
12-31-2003, 05:39 AM
I've never looked into creating sound in JAVA. However I do know its possible to create a system beep, or something close to it. Just use a \7 as you would a \n for a line return.


Example:

public class beep
{
public static void main (String[] args)
{
System.out.print("\7");
}
}