pycord icon indicating copy to clipboard operation
pycord copied to clipboard

Voice data stops receiving after ~10 seconds

Open kimjammer opened this issue 7 months ago • 3 comments

Summary

The UDP socket for receiving voice data becomes stuck in not ready state.

Reproduction Steps

  1. Bot joins voice channel
  2. Bot starts recording
  3. Talk for 10+ seconds.
  4. Stop bot recording
  5. Listen to recorded audio.

Minimal Reproducible Code

examples/audio_recording_merged.py

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)

# After ~10 seconds, the ready variable is always False
ready, _, err = select.select([self.socket], [], [self.socket], 0.01) 

Intents

All

System Information

  • Python v3.10.10-final
  • py-cord v2.4.1-final (main branch on github, not 2.4.1 release. But also reproducible on 2.4.1 stable)
  • aiohttp v3.9.1
  • system info: Windows 10 10.0.22635

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have removed my token from display, if visible.

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.

kimjammer avatar Jan 05 '24 18:01 kimjammer