Skip to content
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

[Fix] Receiving voice packets (use system-assigned port) #2857

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

Lepterion
Copy link
Contributor

Description

This pull request modifies DiscordVoiceAPIClient and AudioClient implementations in order to allow receiving packets from Discord's voice UDP server.
The reason for inability to receive voice packets from Discord was that the library used to send Select Protocol Request with invalid UDP port, which caused Discord to send packets that then could not be captured. Now it sends the port which has been assigned and bound automatically.

Changes

DiscordVoiceAPIClient:

  • SendSelectProtocol() now sends IP from discovery with port that was assigned to the UDP client by the system.
  • Removed redundant parameter from previously mentioned method.

AudioClient:

  • In ProcessPacketAsync() removed redundant code that used to receive port from IP discovery. Now we only need IP so everything regarding port is redundant.
  • Changed DiscordVoiceAPIClient.SendSelectProtocol() call in order to match new parameters.

Related Issues

@Misha-133
Copy link
Member

Thanks for the contribution!
I will look into this later if I ever manage to get a test setup working

@Misha-133 Misha-133 enabled auto-merge (squash) February 23, 2024 22:13
@Misha-133 Misha-133 merged commit 1a16f4d into discord-net:dev Feb 23, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question]: Reading an Audio-Stream
2 participants