Modifier and Type | Field and Description |
---|---|
private short[] |
frameData |
private byte[] |
residualData |
private int |
residualSize |
Constructor and Description |
---|
Sample(BufferedReader reader,
int numChannels)
Reads a sample from the input reader.
|
Sample(short[] frameData,
byte[] residualData)
Constructs a RELP Sample from its component parts
|
Sample(short[] frameData,
byte[] residualData,
int residualSize)
Constructs a Sample from its component parts
|
Modifier and Type | Method and Description |
---|---|
boolean |
compare(Sample other)
Compares two samples.
|
void |
dump()
Dumps the sample:
|
void |
dumpBinary(ByteBuffer bb)
Dumps the samples to the given ByteBuffer
|
void |
dumpBinary(DataOutputStream os)
Dumps the samples to the given stream
|
short[] |
getFrameData()
Gets the frame data associated with this sample
|
int |
getFrameData(int which)
Returns the normalized frame data.
|
byte[] |
getResidualData()
Gets the residual data associated with this sample
|
int |
getResidualData(int which)
Returns the normalized residual data.
|
int |
getResidualSize()
Returns the number of residuals in this Sample.
|
static Sample |
loadBinary(ByteBuffer bb)
Loads the samples from the byte bufer
|
static Sample |
loadBinary(DataInputStream dis)
Loads the samples from the given channel
|
private final short[] frameData
private final byte[] residualData
private final int residualSize
public Sample(short[] frameData, byte[] residualData)
frameData
- the framedataresidualData
- the residual datapublic Sample(short[] frameData, byte[] residualData, int residualSize)
frameData
- the framedataresidualData
- the residual datapublic Sample(BufferedReader reader, int numChannels)
reader
- the input reader to read the data fromnumChannels
- the number of channels per framepublic short[] getFrameData()
public byte[] getResidualData()
public int getResidualSize()
public int getResidualData(int which)
which
- the index of the data of interestpublic int getFrameData(int which)
which
- the index of the data of interestpublic void dump()
public void dumpBinary(ByteBuffer bb) throws IOException
bb
- the ByteBuffer to write the data to.IOException
- if IO error occurspublic void dumpBinary(DataOutputStream os) throws IOException
os
- the DataOutputStream to write the data to.IOException
- if IO error occurspublic static Sample loadBinary(ByteBuffer bb) throws IOException
bb
- the byte buffer to read the data from.IOException
- if IO error occurspublic static Sample loadBinary(DataInputStream dis) throws IOException
dis
- the DataInputStream to read the data from.IOException
- if IO error occursWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses