-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
Voice data stops receiving after ~10 seconds #2310
Comments
I tried it with multiple sinks and logged it in multiple ways. The voice data just stops recording after roughly 14s-15s. |
Also replicated on MacOS |
Replicated on Linux Debian. |
Replicated on Windows. I tried to maintain the connection by sending audio packets like ... # existing code from discord/voice_client.py
try:
data = self.socket.recv(4096)
except OSError:
self.stop_recording()
continue
self.unpack_audio(data)
# == ADDED ==
self.empty_socket()
self.send_audio_packet(b"\xf8\xff\xfe")
# ===========
# ...existing code below
self.stopping_time = time.perf_counter()
... However, there'd be a background noise when the user is speaking. Therefore, my approach was to mute the bot itself in my code: await ctx.guild.change_voice_state(channel=channel, self_mute=True) I could neither understand the socket connection details from the documentation nor had an experience with sockets, but I assumed it was due to improper connection maintenance handling. Best |
Summary
The UDP socket for receiving voice data becomes stuck in not ready state.
Reproduction Steps
Minimal Reproducible Code
Expected Results
The UDP socket continues to become ready when more data is available, and the recorded audio file contains the full duration of audio.
Actual Results
The UDP socket becomes stuck in the not ready state, and the audio file cuts off after ~10 seconds.
discord/voice_client.py Line 833 (on main)
Intents
All
System Information
Checklist
Additional Context
For the first ~10 seconds, the socket cycles between ready and not ready as more voice data is streamed in. However, the socket suddenly becomes stuck in the not ready state for no apparent reason.
The text was updated successfully, but these errors were encountered: