Package discord4j.voice
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:
receive()
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BUFFER_SIZE
Deprecated.static AudioReceiver
NO_OP
Deprecated.
-
Constructor Summary
Constructors Constructor Description AudioReceiver()
Deprecated.AudioReceiver(ByteBuffer buffer)
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ByteBuffer
getBuffer()
Deprecated.void
receive()
Deprecated.Called when audio is received.abstract void
receive(char sequence, int timestamp, int ssrc, byte[] audio)
Deprecated.Called when audio is received, automatically extracting useful information.
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
Deprecated.- See Also:
- Constant Field Values
-
NO_OP
public static final AudioReceiver NO_OP
Deprecated.
-
-
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.
-
-