refactor(voice): Strict type checking in voice internals & DAVE Support (rec)#3159
Open
Paillat-dev wants to merge 35 commits into
Open
refactor(voice): Strict type checking in voice internals & DAVE Support (rec)#3159Paillat-dev wants to merge 35 commits into
Paillat-dev wants to merge 35 commits into
Conversation
Discord enforces DAVE (E2E encryption) on all voice channels. py-cord currently decodes Opus packets before stripping the DAVE application-layer encryption, causing OpusError: corrupted stream and making voice reception completely non-functional. Changes: - reader.py: Rewrite decrypt_rtp() to call dave.decrypt() BEFORE Opus decoding. Handles SSRC-to-user_id race condition by trying all known DAVE user IDs when the mapping is not yet populated, then caching the result. Falls back to OPUS_SILENCE on decrypt failure. - opus.py: Remove erroneous dave.decrypt() call in _decode_packet() that was applied to already-decoded PCM data, corrupting the audio stream. - router.py: Catch OpusError and AssertionError in _do_run() gracefully, emitting a single warning instead of crashing the router thread. Fixes: #3139
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/3159/head:pr-3159
git checkout pr-3159This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3159/head |
Paillat-dev
commented
Mar 19, 2026
This was
linked to
issues
Mar 19, 2026
Open
Paillat-dev
force-pushed
the
fix/voice-rec-2
branch
from
March 19, 2026 14:53
3890460 to
fee38b7
Compare
Paillat-dev
commented
Mar 20, 2026
Paillat-dev
commented
Mar 20, 2026
Paillat-dev
commented
Mar 20, 2026
11 tasks
3 tasks
Co-authored-by: Snazzah <me@snazzah.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
This was referenced Jun 15, 2026
Closed
|
I can confirm this works after building a bot on top of this PR! |
Signed-off-by: Paillat <paillat@pycord.dev>
Paillat-dev
marked this pull request as ready for review
June 15, 2026 21:40
Paillat-dev
requested review from
DA-344,
Dorukyum,
NeloBlivion,
Soheab and
plun1331
June 15, 2026 21:40
This was referenced Jul 12, 2026
ATOMIC09
added a commit
to ATOMIC09/YuukaDiscordBot
that referenced
this pull request
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.