Package net.dv8tion.jda.internal.audio
Class AudioPacket
java.lang.Object
net.dv8tion.jda.internal.audio.AudioPacket
Represents the contents of a audio packet that was either received from Discord or
will be sent to discord.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final byte
This is Discord's RTP Profile Payload type.
I've yet to find actual documentation on what the bits inside this value represent.static final byte
Bit index 0 and 1 represent the RTP Protocol version used. -
Constructor Summary
ConstructorsConstructorDescriptionAudioPacket
(byte[] rawPacket) AudioPacket
(DatagramPacket packet) AudioPacket
(ByteBuffer buffer, char seq, int timestamp, int ssrc, ByteBuffer encodedAudio) -
Method Summary
Modifier and TypeMethodDescriptionasEncryptedPacket
(CryptoAdapter crypto, ByteBuffer buffer) static AudioPacket
decryptAudioPacket
(CryptoAdapter crypto, DatagramPacket packet) byte[]
char
int
getSSRC()
int
-
Field Details
-
RTP_HEADER_BYTE_LENGTH
public static final int RTP_HEADER_BYTE_LENGTH- See Also:
-
RTP_VERSION_PAD_EXTEND
public static final byte RTP_VERSION_PAD_EXTENDBit index 0 and 1 represent the RTP Protocol version used. Discord uses the latest RTP protocol version, 2.
Bit index 2 represents whether or not we pad. Opus uses an internal padding system, so RTP padding is not used.
Bit index 3 represents if we use extensions.
Bit index 4 to 7 represent the CC or CSRC count. CSRC is Combined SSRC.- See Also:
-
RTP_PAYLOAD_TYPE
public static final byte RTP_PAYLOAD_TYPEThis is Discord's RTP Profile Payload type.
I've yet to find actual documentation on what the bits inside this value represent.- See Also:
-
-
Constructor Details
-
AudioPacket
-
AudioPacket
public AudioPacket(byte[] rawPacket) -
AudioPacket
-
-
Method Details
-
getHeader
public byte[] getHeader() -
getEncodedAudio
-
getSequence
public char getSequence() -
getSSRC
public int getSSRC() -
getTimestamp
public int getTimestamp() -
asEncryptedPacket
-
decryptAudioPacket
-