Class opus

java.lang.Object
javaforce.voip.codec.opus
All Implemented Interfaces:
RTPAudioCoder

public class opus extends Object implements RTPAudioCoder
  • Constructor Summary

    Constructors
    Constructor
    Description
    opus(RTP rtp, int rate)
     
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • opus

      public opus(RTP rtp, int rate)
  • Method Details

    • setid

      public void setid(int id)
      Description copied from interface: RTPAudioCoder
      Sets RTP payload ID. This value is exchanged in SDP packets. For most audio codecs this value is fixed and ignored.
      Specified by:
      setid in interface RTPAudioCoder
    • encode

      public byte[] encode(short[] samples)
      Description copied from interface: RTPAudioCoder
      Encodes audio samples into RTP packet.
      Specified by:
      encode in interface RTPAudioCoder
    • decode

      public short[] decode(byte[] encoded, int off, int length)
      Description copied from interface: RTPAudioCoder
      Decodes RTP packet into audio samples.
      Specified by:
      decode in interface RTPAudioCoder
    • getSampleRate

      public int getSampleRate()
      Description copied from interface: RTPAudioCoder
      Returns sample rate.
      Specified by:
      getSampleRate in interface RTPAudioCoder
    • getPacketSize

      public int getPacketSize()
      Description copied from interface: RTPAudioCoder
      Returns encoded packet size (excluding RTP header) -1 = variable sized
      Specified by:
      getPacketSize in interface RTPAudioCoder
    • close

      public void close()
      Description copied from interface: RTPAudioCoder
      Free any resources.
      Specified by:
      close in interface RTPAudioCoder