Skip to content

Voice Client & Packets v2 #1300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 124 commits into
base: master
Choose a base branch
from

Conversation

alexandre433
Copy link
Member

In this pull request, i've updated the current methods & systems to use the newer version of Discord's Gateway version, to the most recent v8

The decryption was also updated to the most recent & preferred by discord aead_aes256_gcm_rtpsize

I've also updated a package that, in my eyes, was really old, and needed some extra love, in the case of, adding some php 8+ features & a Enum to help with some values & strings the trafficcophp/bytebuffer(forked)

On the Voice Packet side I've only been able to store the packets into a temporary file, since I'm mainly working with Windows, and not with WSL.

Any changes that will be required, hit me up!

Updates the current decrypting to the latest preferred "aead_aes256_gcm_rtpsize"
Adds some missing OP Codes
Adds some extra functions to Buffer, that were missing & required for some packets
@valzargaming
Copy link
Member

valzargaming commented Apr 9, 2025

I believe this would close #1290 as well

@valzargaming valzargaming requested a review from a team April 9, 2025 14:36
Use VOICE_CLIENTS_CONNECT instead
@valzargaming
Copy link
Member

I believe the only thing this is waiting on internally is some discussions revolving around the bytebuffer fork. Would it be possible to implement this PR either without changing the existing dependencies of our library, or adding them later in a separate PR?

@alexandre433
Copy link
Member Author

It is possible yes.
I only made the change to update that package.
Since it was a bit outdated, wanted to make Enums and such in it.

Adds User class inside Voice/Client to handle voice client's users' decoding, streaming audio & speaking status
Adds WS class (statically) to call every other function statically
@oliverschloebe
Copy link
Contributor

Any news on this? 💌

@valzargaming
Copy link
Member

To quote the author, "I've been busy lately with some changes at work. Whenever I have some more free time i can go back to the voice part. And finish it once and for all"

Updates WS class to non-static version
…unction anywhere in the project

Adds new UDP client, to handle the events from the udp voice client
Updates usages to fix the issues created with previous changes
Adds new class OpusFfi to use the Libopus from the system to decode the voice (BETA - still has bits of static)
Updates ffmpeg decode parameters
@alexandre433
Copy link
Member Author

v2.0 of the Voice system done.
I'd say it's still in "BETA" phase since the recorded sound has a bit of static in it still.
Haven't tested the output of sounds/playing sounds.

Removes some dev/debugging logs
Updates some functions to return VoiceClient instead of void
Updates OpusFfi class to handle frames of the audio
Adds sodium thrown exception on Voice\Packet class
Adds 1 new property `->shouldRecord` to check whether the UDP messages should be recorded or not, set to `false` by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement features help wanted Requesting assistance from collaborators important voice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chasing a race with stop() and playFile() i think.
3 participants