public class XuggleAudio extends AudioStream
Modifier and Type | Class and Description |
---|---|
protected class |
XuggleAudio.ChunkGetter |
Constructor and Description |
---|
XuggleAudio(File file)
Default constructor that takes the file to read.
|
XuggleAudio(File file,
boolean loop)
Default constructor that takes the file to read.
|
XuggleAudio(InputStream stream)
Construct a xuggle audio object from the stream.
|
XuggleAudio(String url)
Default constructor that takes the location of a file to read.
|
XuggleAudio(String u,
boolean loop)
Default constructor that takes the location of a file to read.
|
XuggleAudio(URL u)
Default constructor that takes the location of a file to read.
|
XuggleAudio(URL u,
boolean loop)
Default constructor that takes the location of a file to read.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the audio stream.
|
long |
getLength()
Returns the length of the audio stream in milliseconds.
|
SampleChunk |
nextSampleChunk()
Retrieve the next SampleChunk from the audio stream.
|
void |
reset()
Reset the audio stream.
|
void |
seek(long timestamp)
Seeks the audio to the given timestamp.
|
iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public XuggleAudio(File file)
file
- The file to read.public XuggleAudio(File file, boolean loop)
file
- The file to read.loop
- Whether to loop indefinitelypublic XuggleAudio(URL u)
u
- The URL of the file to readpublic XuggleAudio(URL u, boolean loop)
u
- The URL of the file to readloop
- Whether to loop indefinitelypublic XuggleAudio(String url)
url
- The URL of the file to readpublic XuggleAudio(String u, boolean loop)
nextSampleChunk()
will
never return null; otherwise this method will return null at the end of
the video.u
- The URL of the file to readloop
- Whether to loop indefinitelypublic XuggleAudio(InputStream stream)
stream
- The streampublic SampleChunk nextSampleChunk()
nextSampleChunk
in class AudioStream
AudioStream.nextSampleChunk()
public void reset()
reset
in class AudioStream
AudioStream.reset()
public long getLength()
getLength
in class AudioStream
AudioStream.getLength()
public void seek(long timestamp)
seek
in class AudioStream
timestamp
- The timestamp to seek toAudioStream.seek(long)
public void close()