ewe.fx
Class Sound

java.lang.Object
  extended byewe.fx.Sound

public class Sound
extends 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);
 


Field Summary
static int MB_ICONASTERISK
           
static int MB_ICONEXCLAMATION
           
static int MB_ICONHAND
           
static int MB_ICONQUESTION
           
static int MB_OK
           
 
Constructor Summary
Sound()
           
 
Method Summary
static void beep()
          Plays the device's default beep sound.
static void beep(int sound)
          Plays one of the device's beep sounds.
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, toString
 

Field Detail

MB_OK

public static final int MB_OK
See Also:
Constant Field Values

MB_ICONHAND

public static final int MB_ICONHAND
See Also:
Constant Field Values

MB_ICONQUESTION

public static final int MB_ICONQUESTION
See Also:
Constant Field Values

MB_ICONEXCLAMATION

public static final int MB_ICONEXCLAMATION
See Also:
Constant Field Values

MB_ICONASTERISK

public static final int MB_ICONASTERISK
See Also:
Constant Field Values
Constructor Detail

Sound

public Sound()
Method Detail

beep

public static void beep()
Plays the device's default beep sound.


beep

public static void beep(int sound)
Plays one of the device's beep sounds.


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 32767
duration - duration in milliseconds