|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.hogent.tarsos.dsp.AudioPlayer
public final class AudioPlayer
This AudioProcessor can be used to sync events with sound. It uses a pattern described in JavaFX Special Effects Taking Java RIA to the Extreme with Animation, Multimedia, and Game Element Chapter 9 page 185:
The variable line is the Java Sound object that actually makes the sound. The write method on line is interesting because it blocks until it is ready for more data.If this AudioProcessor chained with other AudioProcessors the others should be able to operate in real time or process the signal on a separate thread.
Constructor Summary | |
---|---|
AudioPlayer(javax.sound.sampled.AudioFormat format)
Creates a new audio player. |
Method Summary | |
---|---|
boolean |
process(AudioEvent audioEvent)
Process the audio event. |
void |
processingFinished()
Notify the AudioProcessor that no more data is available and processing has finished. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AudioPlayer(javax.sound.sampled.AudioFormat format) throws javax.sound.sampled.LineUnavailableException
format
- The AudioFormat of the buffer.
javax.sound.sampled.LineUnavailableException
- If no output line is available.Method Detail |
---|
public boolean process(AudioEvent audioEvent)
AudioProcessor
process
in interface AudioProcessor
audioEvent
- The audio event that contains audio data.
public void processingFinished()
AudioProcessor
processingFinished
in interface AudioProcessor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |