public class AMR
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
AMR_HEADER
AMR file header
|
static int |
M0_0475 |
static int |
M1_0515 |
static int |
M15_NO_DATA |
static int |
M2_0590 |
static int |
M3_0670 |
static int |
M4_0740 |
static int |
M5_0795 |
static int |
M6_1020 |
static int |
M7_1220 |
static int |
M8_SID |
Constructor and Description |
---|
AMR()
Creates a new AMR.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(byte[] inbuf,
short[] frame)
Decodes an AMR frame (160 audio samples).
|
int |
encode(int mode,
short[] frame,
byte[] outbuf)
Encodes an AMR frame (160 audio samples) using the given AMR mode.
|
static int |
framePayloadBitSize(int mode)
Gets frame payload size, in bits, for a given AMR mode, without considering any AMR header.
|
static int |
frameSize(int mode)
Gets frame size (in bytes) for a given AMR mode including one byte of AMR header (i.e.
|
public static final int M0_0475
public static final int M1_0515
public static final int M2_0590
public static final int M3_0670
public static final int M4_0740
public static final int M5_0795
public static final int M6_1020
public static final int M7_1220
public static final int M8_SID
public static final int M15_NO_DATA
public static final byte[] AMR_HEADER
public static int frameSize(int mode)
mode
- the AMR modepublic static int framePayloadBitSize(int mode)
mode
- the AMR modepublic int encode(int mode, short[] frame, byte[] outbuf)
mode
- AMR modeframe
- input PCM frameoutbuf
- output buffer for the AMR framepublic void decode(byte[] inbuf, short[] frame)
inbuf
- input AMR frameframe
- output buffer for the PCM frame