Class AudioReceiver

java.lang.Object
discord4j.voice.AudioReceiver

@Deprecated public abstract class AudioReceiver extends Object
Deprecated.
Discord does not officially support bots receiving audio. It is not guaranteed that this functionality works properly. Use at your own risk.
Used to receive audio.

The receiver uses a shared buffer. Keep this in mind when implementing.

See Also:
  • Field Details

    • DEFAULT_BUFFER_SIZE

      public static final int DEFAULT_BUFFER_SIZE
      Deprecated.
      See Also:
    • NO_OP

      public static final AudioReceiver NO_OP
      Deprecated.
  • Constructor Details

    • AudioReceiver

      public AudioReceiver()
      Deprecated.
    • AudioReceiver

      public AudioReceiver(ByteBuffer buffer)
      Deprecated.
  • Method Details

    • getBuffer

      public ByteBuffer getBuffer()
      Deprecated.
    • receive

      public void receive()
      Deprecated.
      Called when audio is received. After reading, the implementor is expected to clear the buffer.
    • receive

      public abstract void receive(char sequence, int timestamp, int ssrc, byte[] audio)
      Deprecated.
      Called when audio is received, automatically extracting useful information.
      Parameters:
      sequence - The sequence of the packet.
      timestamp - The timestamp of the packet.
      ssrc - The ssrc of the audio source.
      audio - The Opus-encoded audio.