| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.fmj.media.codec.audio.ulaw.MuLawEncoderUtil
public class MuLawEncoderUtil
Turns 16-bit linear PCM values into 8-bit mu-law bytes. Adapted from code by Marc Sweetgall at http://www.codeproject.com/csharp/g711audio.asp
| Field Summary | |
|---|---|
| static int | BIAS | 
| static int | MAX | 
| Constructor Summary | |
|---|---|
| MuLawEncoderUtil() | |
| Method Summary | |
|---|---|
|  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) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int BIAS
public static final int MAX
| Constructor Detail | 
|---|
public MuLawEncoderUtil()
| Method Detail | 
|---|
public boolean getZeroTrap()
public void setZeroTrap(boolean value)
public static byte muLawEncode(int pcm)
pcm - A 16-bit pcm value
public static byte muLawEncode(short pcm)
pcm - A 16-bit pcm value
public 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)
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||