public final class AudioPlayer extends java.lang.Object implements AudioProcessor
The variable LineWavelet is the Java Sound object that actually makes the sound. The write method on LineWavelet 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 and Description |
---|
AudioPlayer(javax.sound.sampled.AudioFormat format)
Creates a new audio player.
|
AudioPlayer(javax.sound.sampled.AudioFormat format,
int bufferSize) |
AudioPlayer(TarsosDSPAudioFormat format) |
AudioPlayer(TarsosDSPAudioFormat format,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
long |
getMicroSecondPosition() |
boolean |
process(AudioEvent audioEvent)
Process the audio event.
|
void |
processingFinished()
Notify the AudioProcessor that no more data is available and processing
has finished.
|
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 LineWavelet is available.public AudioPlayer(javax.sound.sampled.AudioFormat format, int bufferSize) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
public AudioPlayer(TarsosDSPAudioFormat format, int bufferSize) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
public AudioPlayer(TarsosDSPAudioFormat format) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
public long getMicroSecondPosition()
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