Sounds Java. Is there a default system sound?

Hi, I'm trying to write an application that will play in morse code. I just wanted to know if there was a default system sound in java, for example, some kind of sound, or do I need to download some kind of sound file from the Internet?
+4
source share
3 answers

You can:

Print the ASCII bell symbol on the remote (beeps):

public class DoBeep { public static main(String args[]) { System.out.print("\007"); // bell ASCII char System.out.flush(); } } 

Use the beep() method, which will use an audio signal on the motherboard:

 import java.awt.*; public class DoBeep { public static void main(String args[]) { Toolkit.getDefaultToolkit().beep(); } } 
+6
source

Check out the Java Sound API , which can play MIDI signals.

+2
source

For some tips you can take a look at jMorse . This should not impede your efforts, but rather provide a link.

+1
source

Source: https://habr.com/ru/post/1302999/


All Articles