public class JavaSoundAudioGrabber extends AudioGrabber
listeners
Constructor and Description |
---|
JavaSoundAudioGrabber(AudioFormat format)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
fireAudioAvailable()
Fire the event and audio is now available
|
long |
getLength()
Returns the length of the audio stream in milliseconds.
|
boolean |
isStopped()
Whether the stream is stopped or not.
|
SampleChunk |
nextSampleChunk()
Retrieve the next SampleChunk from the audio stream.
|
void |
run()
Start the stream grabbing.
|
void |
setFormat(AudioFormat format)
Set the audio format of this audio object.
|
void |
setMaxBufferSize(int maxBufferSize)
Set the maximum size buffer to be returned.
|
void |
stop()
Stop the stream grabbing
|
addAudioGrabberListener, removeAudioGrabberListener, reset
iterator, seek
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public JavaSoundAudioGrabber(AudioFormat format)
format
- The format to attempt to open the sound linepublic void run()
run
in interface Runnable
run
in class AudioGrabber
AudioGrabber.run()
public void stop()
stop
in class AudioGrabber
AudioGrabber.stop()
public boolean isStopped()
isStopped
in class AudioGrabber
AudioGrabber.isStopped()
protected void fireAudioAvailable()
fireAudioAvailable
in class AudioGrabber
public void setFormat(AudioFormat format)
setFormat
in class Audio
format
- The format of the audio dataAudio.setFormat(org.openimaj.audio.AudioFormat)
public SampleChunk nextSampleChunk()
nextSampleChunk
in class AudioStream
AudioStream.nextSampleChunk()
public void setMaxBufferSize(int maxBufferSize)
maxBufferSize
- public long getLength()
getLength
in class AudioStream
AudioStream.getLength()