utilities
Class Sound

java.lang.Object
  extended by utilities.Sound

public class Sound
extends Object

Provides a way to play a sound through the computer's default sound hardware. WAV, AU, AIFF, and MIDI sound formats are all supported.

Author:
Mark Jensen Mark P Jensen Created on: Apr 2, 2007

Constructor Summary
Sound(String file)
          Create a Sound that will play the given file
Sound(URL url)
          Create a Sound from the given URL
 
Method Summary
 void loop()
          Starts playing this sound in a loop
 void play()
          Starts playing this sound
 void stop()
          Stops playing this sound
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sound

public Sound(String file)
Create a Sound that will play the given file

Parameters:
file - the full path of the file of the sound to be played.

Sound

public Sound(URL url)
Create a Sound from the given URL

Parameters:
url - the absolute URL of the sound to be played.
Method Detail

play

public void play()
Starts playing this sound


stop

public void stop()
Stops playing this sound


loop

public void loop()
Starts playing this sound in a loop