net.sf.fmj.media.codec.audio.alaw
Class ALawDecoderUtil

java.lang.Object
  extended by 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


Constructor Summary
ALawDecoderUtil()
           
 
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
 

Constructor Detail

ALawDecoderUtil

public ALawDecoderUtil()
Method Detail

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 bytes
decoded - 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)