public class OneSecondClipReader extends Object implements InputStreamObjectReader<List<SampleBuffer>>
SampleBuffer
s that each contain 1 second of audio. The number of samples in
each sample buffer may not be the same, as the length of the buffers is calculated
from the format of the audio in the stream.Constructor and Description |
---|
OneSecondClipReader() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(InputStream stream,
String name)
Returns true if the stream can be read, or false otherwise.
|
List<SampleBuffer> |
read(InputStream stream)
Read an object from the source
|
public OneSecondClipReader()
public List<SampleBuffer> read(InputStream stream) throws IOException
read
in interface ObjectReader<List<SampleBuffer>,InputStream>
stream
- the sourceIOException
- if an error occursObjectReader.read(java.lang.Object)
public boolean canRead(InputStream stream, String name)
Typically implementations will read just the first few bytes from the
stream to determine if the data can be read. This method is not normally
called directly; rather,
IOUtils.canRead(InputStreamObjectReader, java.io.BufferedInputStream, String)
should be used instead as it is capable of resetting the stream to its
initial condition.
canRead
in interface InputStreamObjectReader<List<SampleBuffer>>
canRead
in interface ObjectReader<List<SampleBuffer>,InputStream>
stream
- the input streamname
- the name of the file behind the stream (can be null).InputStreamObjectReader
can read the stream;
false otherwise.InputStreamObjectReader.canRead(java.io.InputStream, java.lang.String)