|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectaudio.AbstractCODEC
audio.AudioCodecAlaw
public class AudioCodecAlaw
Converts a 16-bit linear PCM stream from and to 8-bit A-law.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface audio.AudioInterface |
|---|
AudioInterface.Packetizer |
| Field Summary | |
|---|---|
private static int |
QUANT_MASK
|
private int |
sampleSize
|
private static int[] |
seg_end
|
private static int |
SEG_MASK
|
private static int |
SEG_SHIFT
|
private static int |
SIGN_BIT
|
| Fields inherited from class audio.AbstractCODEC |
|---|
audio, inputPcmBuf, outputPcmBuf |
| Constructor Summary | |
|---|---|
AudioCodecAlaw(AudioInterfacePCM audio)
Constructs A-Law CODEC above existing PCM audio interface |
|
| Method Summary | |
|---|---|
private static short |
alaw2linear(byte alaw_value)
Converts an 8-bit A-law value to 16-bit linear PCM |
void |
convertFromPCM(byte[] in,
byte[] out)
Decodes data from PCM, i.e. converts samples from CODEC to A-Law format. |
void |
convertToPCM(byte[] in,
byte[] out)
Encodes data to PCM, i.e. converts samples from A-Law to CODEC format. |
int |
getSampleSize()
Returns the minimum sample size for use in creating buffers etc. |
int |
getVoicePduSubclass()
Gets the VoicePDU subclass attribute of the AbstractAudio object |
private static byte |
linear2alaw(short pcm_value)
Converts a 16-bit linear PCM value to 8-bit A-law |
| Methods inherited from class audio.AbstractCODEC |
|---|
cleanUp, getByFormat, readWithTimestamp, setAudioSender, startPlay, startRecording, startRinging, stopPlay, stopRecording, stopRinging, writeBuffered, writeDirectly |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int sampleSize
private static final int SIGN_BIT
private static final int QUANT_MASK
private static final int SEG_SHIFT
private static final int SEG_MASK
private static final int[] seg_end
| Constructor Detail |
|---|
public AudioCodecAlaw(AudioInterfacePCM audio)
| Method Detail |
|---|
public int getVoicePduSubclass()
getVoicePduSubclass in interface AudioInterfacegetVoicePduSubclass in class AbstractCODECpublic int getSampleSize()
public void convertToPCM(byte[] in,
byte[] out)
convertToPCM in class AbstractCODEC
public void convertFromPCM(byte[] in,
byte[] out)
convertFromPCM in class AbstractCODECprivate static byte linear2alaw(short pcm_value)
private static short alaw2linear(byte alaw_value)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||