public class MuLawEncoderUtil
extends java.lang.Object
Constructor and Description |
---|
MuLawEncoderUtil() |
Modifier and Type | Method and Description |
---|---|
boolean |
getZeroTrap()
Sets whether or not all-zero bytes are encoded as 2 instead.
|
static void |
muLawEncode(boolean bigEndian,
byte[] data,
int offset,
int len,
byte[] target) |
static byte |
muLawEncode(int pcm)
Encode a pcm value into a mu-law byte
|
static byte |
muLawEncode(short pcm)
Encode a pcm value into a mu-law byte
|
static void |
muLawEncodeBigEndian(byte[] data,
int offset,
int len,
byte[] target) |
static void |
muLawEncodeLittleEndian(byte[] data,
int offset,
int len,
byte[] target)
Encode an array of pcm values into a pre-allocated target array
|
void |
setZeroTrap(boolean value) |
public static final int BIAS
public static final int MAX
public boolean getZeroTrap()
public void setZeroTrap(boolean value)
public static byte muLawEncode(int pcm)
pcm
- A 16-bit pcm valuepublic static byte muLawEncode(short pcm)
pcm
- A 16-bit pcm valuepublic static void muLawEncodeLittleEndian(byte[] data, int offset, int len, byte[] target)
data
- An array of bytes in Little-Endian formattarget
- A pre-allocated array to receive the mu-law bytes. This array must be at least half the size of the source.public static void muLawEncodeBigEndian(byte[] data, int offset, int len, byte[] target)
public static void muLawEncode(boolean bigEndian, byte[] data, int offset, int len, byte[] target)