T - subtype of AudioBufferpublic class TimestampLimitedSignalSource<T extends AudioBuffer> extends Object implements SignalSource<T>, Closeable
SignalSource.
Delivers AudioBuffers as long as the source delivers them and
AudioBuffer.getTimestamp(TimeUnit) <
getMaxTimestamp(java.util.concurrent.TimeUnit).| Constructor and Description |
|---|
TimestampLimitedSignalSource(SignalSource<T> signalSource,
long maxTimestampInMS)
Creates a timestamp limited signal source.
|
TimestampLimitedSignalSource(SignalSource<T> signalSource,
long maxTimestamp,
TimeUnit timeUnit)
Creates a timestamp limited signal source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying
SignalSource, if it implements Closeable. |
long |
getMaxTimestamp(TimeUnit timeUnit)
Max timestamp up to which to read.
|
SignalSource<T> |
getSignalSource()
Warpped signal source.
|
T |
read()
Provide the next chunk of output data.
|
void |
reset()
Reset the internal state of this AudioGenerator.
|
String |
toString() |
public TimestampLimitedSignalSource(SignalSource<T> signalSource, long maxTimestampInMS)
signalSource - signal source to read frommaxTimestampInMS - max timestamp up to which to read in mspublic TimestampLimitedSignalSource(SignalSource<T> signalSource, long maxTimestamp, TimeUnit timeUnit)
signalSource - signal source to read fromtimeUnit - time unit for the timestampmaxTimestamp - max timestamp up to which to readpublic long getMaxTimestamp(TimeUnit timeUnit)
timeUnit - desired unitpublic SignalSource<T> getSignalSource()
public T read() throws IOException
SignalSourceSignalSource data, typically an SignalPullProcessor.read in interface SignalSource<T extends AudioBuffer>AudioBuffer, null if no more data is availableIOException - if something goes wrongpublic void reset()
SignalSourceSignalSource.reset() method.reset in interface SignalSource<T extends AudioBuffer>public void close()
throws IOException
SignalSource, if it implements Closeable.close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2011–2020 tagtraum industries incorporated. All rights reserved.