audiojury.proxy
Class SoundUtility

java.lang.Object
  |
  +--audiojury.proxy.SoundUtility

public class SoundUtility
extends java.lang.Object

Contains common sound playback operations carried out by the client and the administrator program.
Please note, for proper operation we usually do not recommend more than one thread per soundUtility object, unless you know what you are doing!


Constructor Summary
SoundUtility()
          Creates a new SoundUtility object.
 
Method Summary
 boolean playSound(java.lang.String folderpath, Sound snd)
          Plays back a Sound.
 boolean playWaveFile(java.lang.String filename)
          Plays a sound file in the wave format.
 void stopPlayback()
          Stops all play back using this instance of the SoundUtility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundUtility

public SoundUtility()
Creates a new SoundUtility object.

Method Detail

playSound

public boolean playSound(java.lang.String folderpath,
                         Sound snd)
Plays back a Sound. The call does not return until the the sound has finished playing. For that reason never call this function directly from a GUI since this might make the GUI stop responding. Instead encapsulate the call inside a SwingWorker.

Parameters:
folderpath - The path to the directory containing the actual sound file in the Sound.
snd - The Soundto play.
Returns:
True if succeeded to play back the Sound, false otherwise.

playWaveFile

public boolean playWaveFile(java.lang.String filename)
Plays a sound file in the wave format. The call does not return until the the sound has finished playing. For that reason never call this function directly from a GUI since this might make the GUI stop responding. Instead encapsulate the call inside a SwingWorker.

Returns:
True if succeeded to play back the wave file, false otherwise.

stopPlayback

public void stopPlayback()
Stops all play back using this instance of the SoundUtility. Call this method to request that all current threads using this instance of the soundUtility object stop their respective playback.
Please note, for proper operation we usually do not recommend more than one thread per soundUtility object, unless you know what you are doing!