public class G711
extends java.lang.Object
This class provides methods for u-law, A-law and linear PCM conversions.
This implementation is based on the ANSI-C language reference implementations of the CCITT (International Telegraph and Telephone Consultative Committee) G.711, G.721 and G.723 voice compressions, provided by Sun Microsystems, Inc.
Acknowledgement to Sun Microsystems, Inc. for having released the original ANSI-C source code to the public domain.
Modifier and Type | Field and Description |
---|---|
static int |
BIAS
Bias for linear code.
|
Constructor and Description |
---|
G711() |
Modifier and Type | Method and Description |
---|---|
static int |
alaw2linear(int a_val)
Converts an A-law value to 16-bit linear PCM
|
static int |
alaw2ulaw(int aval)
A-law to u-law conversion.
|
static int |
linear2alaw(int pcm_val)
Converts a 16-bit linear PCM value to 8-bit A-law.
|
static int |
linear2ulaw(int pcm_val)
Converts a linear PCM value to u-law
In order to simplify the encoding process, the original linear magnitude
is biased by adding 33 which shifts the encoding range from (0 - 8158) to
(33 - 8191).
|
static int |
ulaw2alaw(int uval)
u-law to A-law conversion.
|
static int |
ulaw2linear(int u_val)
Converts a u-law value to 16-bit linear PCM.
|
public static final int BIAS
public static int linear2alaw(int pcm_val)
public static int alaw2linear(int a_val)
public static int linear2ulaw(int pcm_val)
public static int ulaw2linear(int u_val)
public static int alaw2ulaw(int aval)
public static int ulaw2alaw(int uval)