|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object TConversionTool
Constructor Summary | |
TConversionTool()
|
Method Summary | |
static short |
alaw2linear(byte ulawbyte)
|
static int |
bytesToInt16(byte[] buffer,
int byteOffset,
boolean bigEndian)
Converts 2 successive bytes starting at byteOffset in
buffer to a signed integer sample with 16bit range. |
static int |
bytesToInt24(byte[] buffer,
int byteOffset,
boolean bigEndian)
Converts 3 successive bytes starting at byteOffset in
buffer to a signed integer sample with 24bit range. |
static int |
bytesToInt32(byte[] buffer,
int byteOffset,
boolean bigEndian)
Converts a 4 successive bytes starting at byteOffset in
buffer to a signed 32bit integer sample. |
static void |
intToBytes16(int sample,
byte[] buffer,
int byteOffset,
boolean bigEndian)
Converts a 16 bit sample of type int to 2 bytes in an array. |
static void |
intToBytes24(int sample,
byte[] buffer,
int byteOffset,
boolean bigEndian)
Converts a 24 bit sample of type int to 3 bytes in an array. |
static void |
intToBytes32(int sample,
byte[] buffer,
int byteOffset,
boolean bigEndian)
Converts a 32 bit sample of type int to 4 bytes in an array. |
static byte |
intToUnsignedByte(int sample)
|
static void |
intToUnsignedBytes16(int sample,
byte[] buffer,
int byteOffset,
boolean bigEndian)
|
static void |
intToUnsignedBytes24(int sample,
byte[] buffer,
int byteOffset,
boolean bigEndian)
|
static void |
intToUnsignedBytes32(int sample,
byte[] buffer,
int byteOffset,
boolean bigEndian)
|
static byte |
linear2alaw(short pcm_val)
|
static byte |
linear2ulaw(int sample)
Converts a linear signed 16bit sample to a uLaw byte. |
static short |
ulaw2linear(byte ulawbyte)
|
static int |
unsignedByteToInt(byte b)
|
static int |
unsignedByteToInt16(byte[] buffer,
int offset,
boolean isBigEndian)
|
static int |
unsignedByteToInt24(byte[] buffer,
int offset,
boolean isBigEndian)
|
static int |
unsignedByteToInt32(byte[] buffer,
int offset,
boolean isBigEndian)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TConversionTool()
Method Detail |
public static int bytesToInt16(byte[] buffer, int byteOffset, boolean bigEndian)
byteOffset
in
buffer
to a signed integer sample with 16bit range.
For little endian, buffer[byteOffset] is interpreted as low byte, whereas it is interpreted as high byte in big endian.
This is a reference function.
public static int bytesToInt24(byte[] buffer, int byteOffset, boolean bigEndian)
byteOffset
in
buffer
to a signed integer sample with 24bit range.
For little endian, buffer[byteOffset] is interpreted as lowest byte, whereas it is interpreted as highest byte in big endian.
This is a reference function.
public static int bytesToInt32(byte[] buffer, int byteOffset, boolean bigEndian)
byteOffset
in
buffer
to a signed 32bit integer sample.
For little endian, buffer[byteOffset] is interpreted as lowest byte, whereas it is interpreted as highest byte in big endian.
This is a reference function.
public static short ulaw2linear(byte ulawbyte)
public static byte linear2ulaw(int sample)
public static short alaw2linear(byte ulawbyte)
public static byte linear2alaw(short pcm_val)
public static void intToBytes16(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
int
to 2 bytes in an array.
sample
is interpreted as signed (as Java does).
For little endian, buffer[byteOffset] is filled with low byte of sample, and buffer[byteOffset+1] is filled with high byte of sample + sign bit.
For big endian, this is reversed.
Before calling this function, it should be assured that
sample
is in the 16bit range - it will not be clipped.
This is a reference function.
public static void intToBytes24(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
int
to 3 bytes in an array.
sample
is interpreted as signed (as Java does).
For little endian, buffer[byteOffset] is filled with low byte of sample, and buffer[byteOffset+2] is filled with the high byte of sample + sign bit.
For big endian, this is reversed.
Before calling this function, it should be assured that
sample
is in the 24bit range - it will not be clipped.
This is a reference function.
public static void intToBytes32(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
int
to 4 bytes in an array.
sample
is interpreted as signed (as Java does).
For little endian, buffer[byteOffset] is filled with lowest byte of sample, and buffer[byteOffset+3] is filled with the high byte of sample + sign bit.
For big endian, this is reversed.
This is a reference function.
public static int unsignedByteToInt(byte b)
public static int unsignedByteToInt16(byte[] buffer, int offset, boolean isBigEndian)
public static int unsignedByteToInt24(byte[] buffer, int offset, boolean isBigEndian)
public static int unsignedByteToInt32(byte[] buffer, int offset, boolean isBigEndian)
public static byte intToUnsignedByte(int sample)
public static void intToUnsignedBytes16(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
public static void intToUnsignedBytes24(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
public static void intToUnsignedBytes32(int sample, byte[] buffer, int byteOffset, boolean bigEndian)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |