Closed davidffa closed 2 months ago
Please also adjust the test with these changes
The CryptoAdapterTest
uses the AudioPacket#asEncryptedPacket
method that always writes the RTP header flags as 0x80 (without the header extension bit) and never writes the header extension length, so all the tests still pass.
Pull Request Etiquette
Changes
Closes Issue: NaN
Description
With the new update (v5.1.0) that uses the new voice encryption modes, when the bot receives audio from regular users (not bots) it throws opus decoder errors in the debug logs. The issue is that the header extension (present in user's audio packets) is not being stripped from the encoded (but decrypted) audio packet. This PR fixes that by offseting the decrypted audio ByteBuffer by
4 * extension length in the RTP header
.