Class 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:
    receive()
    • Constructor Detail

      • AudioReceiver

        public AudioReceiver()
        Deprecated.
      • AudioReceiver

        public AudioReceiver​(ByteBuffer buffer)
        Deprecated.
    • Method Detail

      • 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.