Voice chat: no packet longer than its length's byte

The voice messages give a packet's length in a byte, but a frame could be
encoded up to 400 bytes: at 48 and 64 kbps, a frame past 255 bytes (a loud
one, as Opus's rate varies) had its length cut short, and the host, finding
it unequal to what came, dropped it. The packet's limit is now 255, which
the encoder fits a louder frame to; 64 kbps's frames are 160 bytes.

The voice_audio.h part only (not the commit's d3d8_gl.c comment removal).

(cherry picked from commit 003da0187e1bbd52baad8c3f9c3061c2a61ba55b)
This commit is contained in:
xshxdex98 authored and MrBruh committed 2026-10-10 13:59:03 +13:00
1 parent f815e1ccba
commit 137d15b95f
1 file changed
+4 -2
+4 -2
View File
@@ -12,8 +12,10 @@ dsound_sdl.c (the mix).
/* a frame: 20 ms at 48 kHz, mono */
#define VOICE_FRAME_SAMPLES 960
/* the longest packet sent or taken (64 kbps is 160 bytes a frame) */
#define VOICE_MAXIMUM_PACKET 400
/* the longest packet sent or taken: the voice messages give its length in a
byte (network_voice.c). 64 kbps is 160 bytes a frame; the encoder fits a
louder one to it rather than going over */
#define VOICE_MAXIMUM_PACKET 255
/* opens the microphone (on another thread: not at once) or closes it;
whether it is open */