public class AudioDoubleDataSource extends BaseDoubleDataSource
Modifier and Type | Field and Description |
---|---|
protected AudioInputStream |
ais |
protected boolean |
bAutomaticClippingControl |
protected boolean |
bigEndian |
protected byte[] |
byteBuf |
static int |
BYTEBUFFER_LENGTH |
protected int |
bytesPerSample |
protected boolean |
hasMoreData |
protected int |
samplingRate |
protected int |
scaleInd |
protected double[] |
scales |
dataLength, inputSource
NOT_SPECIFIED
Constructor and Description |
---|
AudioDoubleDataSource(AudioInputStream ais) |
AudioDoubleDataSource(AudioInputStream ais,
boolean isAutomaticClippingControl)
Initialise this double data source with the AudioInputStream from which samples can be read.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
The number of doubles that can currently be read from this double data source without blocking.
|
AudioFormat |
getAudioFormat() |
int |
getData(double[] target,
int targetPos,
int length)
Try to get length doubles from this DoubleDataSource, and copy them into target, starting from targetPos.
|
long |
getDataLength()
Get the total length of the data in this data source, if available.
|
int |
getSamplingRate()
Get the sampling rate of the audio data.
|
boolean |
hasMoreData()
Whether or not any more data can be read from this data source.
|
getAllData, getData, getData
public static final int BYTEBUFFER_LENGTH
protected AudioInputStream ais
protected byte[] byteBuf
protected int samplingRate
protected int bytesPerSample
protected boolean bigEndian
protected boolean hasMoreData
protected boolean bAutomaticClippingControl
protected double[] scales
protected int scaleInd
public AudioDoubleDataSource(AudioInputStream ais, boolean isAutomaticClippingControl)
ais
- aisisAutomaticClippingControl
- isAutomaticClippingControlIllegalArgumentException
- if the audio input stream does not have 8, 16 or 24 bits per sample.public AudioDoubleDataSource(AudioInputStream ais)
public int getSamplingRate()
public AudioFormat getAudioFormat()
public int getData(double[] target, int targetPos, int length)
getData
in interface DoubleDataSource
getData
in class BaseDoubleDataSource
target
- the double array to write intotargetPos
- position in target where to start writinglength
- the amount of data requestedpublic boolean hasMoreData()
hasMoreData
in interface DoubleDataSource
hasMoreData
in class BaseDoubleDataSource
public int available()
available
in interface DoubleDataSource
available
in class BaseDoubleDataSource
public long getDataLength()
BaseDoubleDataSource
getDataLength
in interface DoubleDataSource
getDataLength
in class BaseDoubleDataSource
Copyright © 2000–2016 DFKI GmbH. All rights reserved.