private class SoundPlayer.SoundPlayerThread
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUFSIZ |
private byte[] |
data |
private boolean |
playDone |
private java.util.List<javax.sound.sampled.AudioInputStream> |
playList |
| Constructor and Description |
|---|
SoundPlayerThread() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(javax.sound.sampled.AudioInputStream ais) |
private void |
awaken() |
private void |
goToSleep() |
boolean |
keepPlaying() |
private javax.sound.sampled.SourceDataLine |
openLine(javax.sound.sampled.AudioFormat audioFormat) |
private boolean |
playSound(javax.sound.sampled.AudioInputStream in)
Play a sound.
|
void |
run() |
private void |
setVolume(javax.sound.sampled.SourceDataLine line,
int vol) |
private void |
sleep(int t) |
void |
startPlaying() |
void |
stopPlaying() |
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, yieldprivate static final int BUFSIZ
private final byte[] data
private final java.util.List<javax.sound.sampled.AudioInputStream> playList
private boolean playDone
private void awaken()
private void goToSleep()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic boolean keepPlaying()
public void startPlaying()
public void stopPlaying()
public void add(javax.sound.sampled.AudioInputStream ais)
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprivate void sleep(int t)
private void setVolume(javax.sound.sampled.SourceDataLine line,
int vol)
private javax.sound.sampled.SourceDataLine openLine(javax.sound.sampled.AudioFormat audioFormat)
private boolean playSound(javax.sound.sampled.AudioInputStream in)
throws java.io.IOException
in - The AudioInputStream to play.java.io.IOException