16 * Play a system sound - not yet implemented.
18 * <TR><TH>aCode</TH><TH>Resulting Sound</TH></TR>
19 * <TR><TD>0</TD><TD>short beep</TD></TR>
20 * <TR><TD>1</TD><TD>double beep</TD></TR>
21 * <TR><TD>2</TD><TD>descending arpeggio</TD></TR>
22 * <TR><TD>3</TD><TD>ascending arpeggio</TD></TR>
23 * <TR><TD>4</TD><TD>long, low beep</TD></TR>
24 * <TR><TD>5</TD><TD>quick ascending arpeggio</TD></TR>
28 public static int C2 = 1056;
30 public static void systemSound (boolean aQueued, int aCode)
45 for(int i = 4; i<8; i++)
53 for(int i = 7; i>3; i--)
67 * Beeps once - not yet implemented.
69 public static void beep()
71 systemSound (true, 0);
75 * Beeps twice - not yet implemented.
77 public static void twoBeeps()
79 systemSound (true, 1);
85 public static void beepSequence()
87 systemSound (true, 3);
93 public static void beepSequenceUp()
101 public static void buzz()
103 systemSound (true, 4);
106 public static void pause(int t)
108 try { Thread.sleep(t); }
109 catch(InterruptedException e){}
113 * Plays a tone, given its frequency and duration. Frequency is audible from about 31 to 2100 Hertz. The
114 * duration argument is in hundreds of a seconds (centiseconds, not milliseconds) and is truncated
115 * at 256, so the maximum duration of a tone is 2.56 seconds.
116 * @param aFrequency The frequency of the tone in Hertz (Hz).
117 * @param aDuration The duration of the tone, in centiseconds. Value is truncated at 256 centiseconds.
119 public static native void playTone (int aFrequency, int aDuration);
122 * Internal method used to play sound sample from a file
123 * @param page the start page of the file
124 * @param len the length of the file
125 * @param freq the frequency
126 * @param vol the volume
128 public static native void playSample(int page, int len, int freq, int vol);
132 * @param file the 8-bit PWM (WAV) sample file
133 * @param freq the average frequency to play the sample at
134 * @param vol the sound volume
136 public static void playSample(File file, int freq, int vol) {
137 playSample(file.getPage(), file.length(), freq, vol);