-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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 slows down then speeds up after pausing and resuming #2354
Comments
This sounds like the file isn't being processed fast enough |
Does this still occur? |
This still occurs. |
Hi, could you see if this issue still occurs? I can't reproduce it. Also, are you running your bot in Docker or a VM? |
Still occurs on the latest master (be56087). Node.js version: 10.7.0 |
Can you send me the music file you're trying to play? If you don't want to send it here, you could send it to me on Discord (my tag is hydrabolt#0001) |
This is the original audio file. https://www.dropbox.com/s/eqa38u33pk45n2y/sample.mp3?dl=0 |
Ok, I can finally reproduce this issue using the file you sent me! |
Ok, after taking a look at what happens in StreamDispatcher and talking to some other library developers, I think it might be an interpolation issue. At the times leading up to and during the speed up, Discord.js isn't sending packets any more frequently than before, so if it's not an interpolation issue I'm not sure what it could be. If anyone has any ideas it would be helpful. (To make sure this wasn't a Discord.js bug, I tested this in Eris to see if I could reproduce it and it seems to occur there too) |
Just to confirm this I set packet interval to a fixed 20ms (normally discord.js would adjust this depending on how long it took to send the current packet) and it still occurred, which gives me more belief that it is indeed an interpolation issue. |
After some consideration I still think this issue isn't Discord.js's -- it's sending packets at the right rate and with the right timestamps and sequences, so I'm putting this down to the Discord client. If I repeatedly play a stream for 3 seconds and pause it for 1 second, I can no longer reproduce this issue; this is already a pretty extreme case. I don't think Discord.js should be responsible for any "glitches" if you decide to play/pause a stream really quickly and repeatedly. Either way thanks for bringing up this issue and making us aware of it, I'm sorry we can't fix it at the moment. As a workaround you could try emulating pauses by adding silence to your audio file at the times you want it to be paused and then play that, but other than that I don't have any suggestions as to how to fix this for you. |
OK, Thank you for researching the issue! |
Actually I think I've just figured out a way to solve this, I'll try and implement it today |
Ok, with the above commit you can use |
Thank you! |
Great to hear! 😄 |
Please describe the problem you are having in as much detail as possible:
After pausing and resuming a song, the voice often slows down and speeds up then returns to normal.
May be related to #2181
I use
[email protected]
and[email protected]
for voice support.This issue occurs whether I use ytdl or not.
Include a reproducible code sample here, if possible:
The issue is more likely to occur after pausing and resuming a song repeatedly, so this code repeats it 4 times.
Further details:
The text was updated successfully, but these errors were encountered: