Package javaforce.voip.codec
Class g711u
java.lang.Object
javaforce.voip.codec.g711u
- All Implemented Interfaces:
RTPAudioCoder
Encodes/decodes g711 packets (U-Law). (North America format)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Free any resources.short[]decode(byte[] encoded, int off, int length) Decodes RTP packet into audio samples.byte[]encode(short[] samples) Encodes audio samples into RTP packet.intReturns encoded packet size (excluding RTP header) -1 = variable sizedintReturns sample rate.voidsetid(int id) Sets RTP payload ID.
-
Constructor Details
-
g711u
-
-
Method Details
-
setid
public void setid(int id) Description copied from interface:RTPAudioCoderSets RTP payload ID. This value is exchanged in SDP packets. For most audio codecs this value is fixed and ignored.- Specified by:
setidin interfaceRTPAudioCoder
-
getPacketSize
public int getPacketSize()Description copied from interface:RTPAudioCoderReturns encoded packet size (excluding RTP header) -1 = variable sized- Specified by:
getPacketSizein interfaceRTPAudioCoder
-
encode
public byte[] encode(short[] samples) Description copied from interface:RTPAudioCoderEncodes audio samples into RTP packet.- Specified by:
encodein interfaceRTPAudioCoder
-
decode
public short[] decode(byte[] encoded, int off, int length) Description copied from interface:RTPAudioCoderDecodes RTP packet into audio samples.- Specified by:
decodein interfaceRTPAudioCoder
-
getSampleRate
public int getSampleRate()Description copied from interface:RTPAudioCoderReturns sample rate.- Specified by:
getSampleRatein interfaceRTPAudioCoder
-
close
public void close()Description copied from interface:RTPAudioCoderFree any resources.- Specified by:
closein interfaceRTPAudioCoder
-