SlaterB hat gesagt.:bei google ist immer von \007 die Rede, z.B.
http://forum.java.sun.com/thread.jspa?threadID=614343&messageID=3800818
public class SpeakerBeep {
public static void main(String[] args) {
System.out.println((char)7);
}
}
public class SpeakerBeep2 {
public static void main(String[] args) {
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
java.awt.Toolkit.getDefaultToolkit().beep();
try { Thread.sleep(500); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
java.awt.Toolkit.getDefaultToolkit().beep();
try { Thread.sleep(500); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
java.awt.Toolkit.getDefaultToolkit().beep();
try { Thread.sleep(300); } catch(InterruptedException e) {}
java.awt.Toolkit.getDefaultToolkit().beep();
try { Thread.sleep(500); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
java.awt.Toolkit.getDefaultToolkit().beep();
try { Thread.sleep(2000); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(500); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(500); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(500); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(500); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
System.out.println((char)7);
try { Thread.sleep(100); } catch(InterruptedException e) {}
}
}
SlaterB hat gesagt.:tztz, dieser Overhead..
public class SpeakerBeep {
public static void main(String[] args) {
start();
}
public static void start() {
ton1();
wartenKurz();
ton1();
wartenKurz();
ton2();
wartenLang();
ton1();
wartenKurz();
ton1();
wartenKurz();
ton2();
wartenLang();
ton1();
wartenKurz();
ton1();
wartenKurz();
ton2();
wartenMittel();
ton2();
wartenLang();
ton1();
wartenKurz();
ton1();
wartenKurz();
ton2();
wartenSehrLang();
ton1();
wartenLang();
ton1();
wartenLang();
ton1();
wartenKurz();
ton1();
wartenKurz();
ton1();
wartenLang();
ton1();
wartenKurz();
ton1();
wartenKurz();
ton1();
wartenKurz();
ton1();
wartenLang();
ton1();
wartenKurz();
ton1();
wartenKurz();
}
public static void wartenKurz() {
try { Thread.sleep(100); } catch(InterruptedException e) {}
}
public static void wartenMittel() {
try { Thread.sleep(300); } catch(InterruptedException e) {}
}
public static void wartenLang() {
try { Thread.sleep(500); } catch(InterruptedException e) {}
}
public static void wartenSehrLang() {
try { Thread.sleep(2000); } catch(InterruptedException e) {}
}
public static void ton1() {
System.out.println((char)7);
}
public static void ton2() {
java.awt.Toolkit.getDefaultToolkit().beep();
}
}
MelodyType wk = MelodyType.WartenKurz;
MelodyType wl = ..;
MelodyType t1 = ..;
MelodyType t2 = ..;
doMelody(t1,wk,t1,wk, ...);