You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a stream with opus that is volume controled volume: true it does NOT destroy the stream upon .end() or .destroy() function calls. In contrary, when source stream ends, it gets destroyed from source.
On playOpusStream in line 71 you can see that a pipe is used to enable for volume adjustments.
With the following code, you execute the destroy function dispatcher.destroy(); and the stream will still run, in the background idle (can be seen using top in terminal)
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:
Make an issue if you have found a bug in the new voice library
Use GitHub Discussions or join our Discord server (we have a new channel, #djs-new-voice, specifically for this!) to ask general questions about the library, give feedback on the library, and get support with upgrading to it
When creating a stream with
opus
that is volume controled volume: true it does NOT destroy the stream upon.end()
or.destroy()
function calls. In contrary, when source stream ends, it gets destroyed from source.On playOpusStream in line 71 you can see that a pipe is used to enable for volume adjustments.
Piping the source stream to current dispatcher creates an intermediate which prevents
_destroy()
from destroying the source opus stream.Reproduce
With the following code, you execute the destroy function
dispatcher.destroy();
and the stream will still run, in the background idle (can be seen usingtop
in terminal)In order to destroy the source stream you must add
volume: false
option in StreamOptionsThis probably is not the intended behaviour, and should probably be handled seperately.
Related errors:
4009986
nodejs/node#32968
Further details:
not essential but causes bots to crash and run artificially slow
The text was updated successfully, but these errors were encountered: