public class Playback
extends java.lang.Thread
Playback
extends from Thread
and allows for playback of a simple sound. The thread doesn't die until
the sound is finished playing, however it is not blocking either. It
will simply play the sound in the "background."
Constructor and Description |
---|
Playback(SimpleSound sound)
Constructor that takes the simple sound to be played
|
Modifier and Type | Method and Description |
---|---|
boolean |
getPlaying()
Method to return true if this playback thread is playing and
false otherwise
|
void |
run()
Starts this thread.
|
void |
stopPlaying()
Stops this thread by breaking the while loop in the run method.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public Playback(SimpleSound sound)
sound
- the simple sound to playpublic void stopPlaying()
public boolean getPlaying()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
JavaSoundException
- if there were problems playing the sound.