Interface OpusDecoder


public interface OpusDecoder
Instances can be obtained by calling VoicechatApi.createDecoder().
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the decoder.
    short[]
    decode(byte[] data)
    Decodes opus encoded audio data to 16 bit PCM audio.
    short[][]
    decode(byte[] input, int frames)
    Decodes the provided packet and recovers previous lost frames using FEC.
    boolean
     
    void
    Resets the decoders state.
  • Method Details

    • decode

      short[] decode(@Nullable byte[] data)
      Decodes opus encoded audio data to 16 bit PCM audio.
      Parameters:
      data - the opus encoded data or null to do PLC
      Returns:
      the 16 bit PCM audio data
    • decode

      short[][] decode(byte[] input, int frames)
      Decodes the provided packet and recovers previous lost frames using FEC.
      Parameters:
      input - the input packet
      frames - the number of frames to return (min 1 for just the current frame)
      Returns:
      an array containing the decoded frames - the length of the array is equal to
    • resetState

      void resetState()
      Resets the decoders state.
    • isClosed

      boolean isClosed()
      Returns:
      if the decoder is closed
    • close

      void close()
      Closes the decoder. Not doing this will result in a memory leak!