Interface RTPAudioCoder

All Known Implementing Classes:
g711a, g711u, g722, g729a, gsm, opus, speex

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 Type
    Method
    Description
    void
    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.
    int
    Returns encoded packet size (excluding RTP header) -1 = variable sized
    int
    Returns sample rate.
    void
    setid(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.