Documentation for implementation of voice receivement for Discord Voice Gateway.
The payload structure of the Discord Voice Gateway is as follows:
Field | Type | Description |
---|---|---|
Version & Flags | 8-bit unsigned | The version of the payload. |
Type | 8-bit unsigned | The type of the payload. |
Sequence | 16-bit unsigned | The sequence of the payload. |
Timestamp | 32-bit unsigned | The timestamp of the payload. |
SSRC | 32-bit unsigned | The SSRC of the payload. |
Audio | n bytes | The audio of the payload. |
![NOTE] The audio is encrypted with the selected encryption mode.
The audio is encrypted with the XSalsa20-Poly1305-Lite encryption mode. The audio is structured as follows:
Field | Type | Description |
---|---|---|
Audio | n bytes | The audio of the payload. |
![NOTE] The audio is encrypted with
secretKeys
, without a nonce.
The audio is encrypted with the XSalsa20-Poly1305 encryption mode. The audio is structured as follows:
Field | Type | Description |
---|---|---|
Nonce | 24 bytes | The nonce of the audio. |
Audio | n bytes | The audio of the payload. |
![NOTE] The nonce is a cryptographically secure random number.
The audio is encrypted with the XSalsa20-Poly1305-Suffix encryption mode. The audio is structured as follows:
Field | Type | Description |
---|---|---|
Nonce | 24 bytes | The nonce of the audio. |
Audio | n bytes | The audio of the payload. |
![NOTE] The nonce sums up 1 for each packet, resetting to 0 after 2 ** 32 packets.