-
-
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
If bot is connected to a voice channel for too long, it stops playing audio. #4021
Comments
This could be caused by the stream collapsing between you and the 3rd party, and your bot not recognizing that it has stopped. Did your bots speaking status also change or? |
Thanks - Do you think I should regularly disconnect it from the voice channel if there has been no activity for a while? I'm wondering if it could be because leave it connected to the voice channel for days without disconnecting. |
Usually, the StreamDispatcher shouldn't stop like that, even if its for long periods at a time. It might be a possibility of having too many dropped packets and the dispatcher just stopping. If you can, can you attempt this again and This can ALSO be caused by the high water mark, but it should end the stream rather than finishing in the matter you described. If none of those solutions are convenient for you, you can also try lavalink by Frederikam. Click for Repo |
I sometimes had this problem when playing from a readableStream. The solution was to write the stream onto an audio file, and then play the audio file. |
Hi there, We're working on a new implementation of Discord's Voice API that has better playback quality and is more reliable than what we currently support in Discord.js v12 - check it out at https://github.com/discordjs/voice! The new library solves many of the issues that users are facing, and as part of this, we're dropping built-in support for voice in our next major release. We have a PR (#5402) that adds native support for our new voice library - once this PR is merged, this issue will be closed. You can still use our new voice library before that PR lands - just take a look at our music bot example to see how to get started upgrading your voice code. By using the boilerplate music player in the example, you can make it even easier to upgrade your code. Note that the PR above only reduces some of the boilerplate code you'd otherwise have to write - you do not have to wait for the PR to be merged to start using the new voice library. If you have any questions about this, feel free to:
|
Hi -
I have a discord bot that plays music in a voice channel.
I leave it connected overnight. Around 3am~ish, a user enters the voice channel and begins playing music just fine. They log out at 5am.
At 9am I wake up and join the voice channel, and music doesn't play. There are no errors thrown in the console.
It's as if everything works perfectly fine, except music doesn't stream through.
Some of my code:
The text was updated successfully, but these errors were encountered: