Skip to content

refactor(voice): Rewrite Voice Internals & DAVE Support (send & receive)#2873

Closed
DA-344 wants to merge 96 commits intoPycord-Development:masterfrom
DA-344:feat/voice-rewrite-and-fixes
Closed

refactor(voice): Rewrite Voice Internals & DAVE Support (send & receive)#2873
DA-344 wants to merge 96 commits intoPycord-Development:masterfrom
DA-344:feat/voice-rewrite-and-fixes

Conversation

@DA-344
Copy link
Contributor

@DA-344 DA-344 commented Aug 21, 2025

Summary

Rewrites voice internals to have a cleaner, easier-to-maintain, voice implementation.

Adds support for DAVE connections.

Voice receive is currently broken

-> This code is partially inspired on discord.py's current voice implementation

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

Related

Fixes #2833

@DA-344 DA-344 changed the title Voice internals rewrite to fix things fix(voice): Voice internals rewrite to fix things Aug 26, 2025
@Lulalaby Lulalaby changed the title refactor(voice): Rewrite Voice Internals & DAVE Support (send) refactor(voice): Rewrite Voice Internals & DAVE Support (send & receive) Mar 8, 2026
@nicokim
Copy link

nicokim commented Mar 8, 2026

Hey! I've been testing this branch for voice receive with DAVE and ran into some issues.

The audio coming out of the Sink is pretty much unintelligible, I attached an mp3 sample. Whisper (ASR) can't even detect the right language, it hallucinates Italian/English when I'm speaking Spanish lol

Some things I found while debugging:

  • ~7% of packets throw OpusError: corrupted stream, but even the ones that "succeed" produce garbled PCM
  • There's a double dave.decrypt() in _decode_packet (opus.py:728) — it decrypts the PCM bytes after Opus decode,
    but DAVE was already handled in decrypt_rtp(). That corrupts the audio
  • PacketRouter._do_run doesn't catch OpusError, so one bad packet kills the receive thread
  • stop_recording() in run()'s finally block can raise if recording already stopped

I know the PR says voice receive is broken, just wanted to share concrete findings in case it helps. Audio sample attached.

whisper_debug_1.mp3

@Lulalaby
Copy link
Member

Lulalaby commented Mar 8, 2026

thanks for your comment. we are already aware tho and debugging it right now

@Lulalaby
Copy link
Member

Lulalaby commented Mar 8, 2026

Handing over changes to #3143 as this PR includes unrelated changes from #2645.
Attribution has been made

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high High Priority voice Related to the voice chat feature

Projects

None yet

7 participants