Package javaforce.voip
Interface RTPAudioCoder
public interface RTPAudioCoder
RTPAudioCoder
Base interface for all audio codec encoders/decoders.
Encoders build RTP packets from raw audio samples.
Decoders build raw audio samples from RTP packets.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Free any resources.short[]decode(byte[] src8, int off, int length) Decodes RTP packet into audio samples.byte[]encode(short[] src16) 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.
-
Method Details
-
setid
void setid(int id) Sets RTP payload ID. This value is exchanged in SDP packets. For most audio codecs this value is fixed and ignored. -
encode
byte[] encode(short[] src16) Encodes audio samples into RTP packet. -
decode
short[] decode(byte[] src8, int off, int length) Decodes RTP packet into audio samples. -
getSampleRate
int getSampleRate()Returns sample rate. -
getPacketSize
int getPacketSize()Returns encoded packet size (excluding RTP header) -1 = variable sized -
close
void close()Free any resources.
-