waba.fx
Class SoundClip

java.lang.Object
  |
  +--waba.fx.SoundClip

public class SoundClip
extends java.lang.Object

SoundClip is a sound clip.

Support for sound clips varies between platforms. Under Java, sound clips are only supported by Java applets - not applications. This is primarily because AudioClips in Java weren't supported in Java applications until the JDK 1.2 without using undocumented method calls. Even when using applets, some Java virtual machines support .wav and .au sound files and some versions don't seem to support either format.

Using a Waba Virtual Machine, .wav format sound clips are supported under Win32 and WinCE. The WabaVM under PalmOS has no support for sound clips. Under Win32 and WinCE, the .wav files for sound clips must exist in a file outside of the programs warp (resource) file.

If you're playing a sound clip under a Windows CE device and you don't hear anything, make sure that the device is set to allow programs to play sounds. To check the setting, look at:

Start->Settings->Volume & Sounds

for the check box:

Enable sounds for: Programs

If it is not checked on, sound clips won't play.

Here is an example that plays a sound:

 SoundClip s = new SoundClip("sound.wav");
 s.play();
 


Constructor Summary
SoundClip(java.lang.String path)
          Loads and constructs a sound clip from a file.
 
Method Summary
 boolean play()
          Plays the sound clip.
 
Methods inherited from class java.lang.Object
hashCode, toString
 

Constructor Detail

SoundClip

public SoundClip(java.lang.String path)
Loads and constructs a sound clip from a file.
Method Detail

play

public boolean play()
Plays the sound clip. Returns true if the sound starts playing and false otherwise.