waba.fx
Class Sound
java.lang.Object
|
+--waba.fx.Sound
- public class Sound
- extends java.lang.Object
Sound is used to play sounds such as beeps and tones.
Playing beeps is supported under all platforms but tones are only supported
where the underlying platform supports generating tones. Tones aren't supported
under Java or Windows CE.
Here is an example that beeps the speaker and plays a tone:
Sound.beep();
Sound.tone(4000, 300);
Constructor Summary |
Sound()
|
Method Summary |
static void |
beep()
Plays the device's default beep sound. |
static void |
tone(int freq,
int duration)
Plays a tone of the specified frequency for the specified
duration. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Sound
public Sound()
beep
public static void beep()
- Plays the device's default beep sound.
tone
public static void tone(int freq,
int duration)
- Plays a tone of the specified frequency for the specified
duration. Tones will only play under Win32 and PalmOS, they won't
play under Java or Windows CE due to underlying platform limitations.
- Parameters:
freq
- frequency in hertz from 32 to 32767duration
- duration in milliseconds