net.sf.fmj.media.codec.audio.alaw
Class ALawDecoderUtil
java.lang.Object
net.sf.fmj.media.codec.audio.alaw.ALawDecoderUtil
public class ALawDecoderUtil
- extends java.lang.Object
Turns 8-bit A-law bytes back into 16-bit PCM values.
Adapted from code by Marc Sweetgall at http://www.codeproject.com/csharp/g711audio.asp
Method Summary |
static void |
aLawDecode(boolean bigEndian,
byte[] data,
int offset,
int length,
byte[] decoded)
|
static short |
aLawDecode(byte alaw)
Decode one a-law byte |
static void |
aLawDecodeBigEndian(byte[] data,
int offset,
int length,
byte[] decoded)
|
static void |
aLawDecodeLittleEndian(byte[] data,
int offset,
int length,
byte[] decoded)
Decode an array of a-law encoded bytes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALawDecoderUtil
public ALawDecoderUtil()
aLawDecode
public static short aLawDecode(byte alaw)
- Decode one a-law byte
- Parameters:
alaw
- The encoded a-law byte
- Returns:
- A short containing the 16-bit result
aLawDecode
public static void aLawDecode(boolean bigEndian,
byte[] data,
int offset,
int length,
byte[] decoded)
aLawDecodeLittleEndian
public static void aLawDecodeLittleEndian(byte[] data,
int offset,
int length,
byte[] decoded)
- Decode an array of a-law encoded bytes
- Parameters:
data
- An array of a-law encoded bytesdecoded
- An array of bytes in Little-Endian format containing the results. Should be twice as big as data.
aLawDecodeBigEndian
public static void aLawDecodeBigEndian(byte[] data,
int offset,
int length,
byte[] decoded)