|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread comirva.audio.AudioPlayer
public class AudioPlayer
This class implements methods for reading and playing audio files. Its ability to read audio files of different formats depends on the installed Java Sound implementations. To obtain plug-ins for different file formats, see e.g. http://tritonus.org/
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AudioPlayer(AudioInputStream ais)
Creates a new instance of the AudioPlayer. |
|
AudioPlayer(File audioFile)
Creates a new instance of the AudioPlayer. |
Method Summary | |
---|---|
(package private) File |
getAudioFile()
|
boolean |
isPaused()
Returns whether the audio player is paused. |
boolean |
isStopped()
Returns whether the audio player is stopped or not. |
void |
run()
This method is called when the thread is started. |
void |
setPaused(boolean isPaused)
Sets the state of the audio player to "paused" or "not paused" depending on the value of the argument isPaused . |
void |
setStopped(boolean isStopped)
Sets the state of the audio player to "stopped" or "not stopped" depending on the value of the argument isStopped . |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AudioPlayer(File audioFile)
audioFile
- the audio file to be playedpublic AudioPlayer(AudioInputStream ais)
ais
- the AudioInputStream which is playedMethod Detail |
---|
File getAudioFile()
public void run()
run
in interface Runnable
run
in class Thread
Runnable.run()
public boolean isPaused()
public void setPaused(boolean isPaused)
isPaused
.
isPaused
- a boolean indicating if the audio player should pause or notpublic boolean isStopped()
public void setStopped(boolean isStopped)
isStopped
.
isStopped
- a boolean indicating if the audio player should stop or not
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |