Closed KalebMills closed 3 years ago
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 (https://github.com/discordjs/discord.js/pull/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:
#djs-new-voice
, specifically for this!) to ask general questions about the library, give feedback on the library, and get support with upgrading to itSpecific to this issue:
This event relies on the voice receive feature, which is undocumented by Discord and prone to breaking quite a lot. As it's an undocumented feature, we cannot guarantee support for it. The new voice library will still have support for voice receive, but even then it will not be a stable feature.
Please describe the problem you are having in as much detail as possible:
I have created a simple bot that is supposed to record audio. To do this, I loop through the users in a channel, and create a read stream for each user. From those read streams, I pipe to a
PassThrough
so I only have to deal with a single stream at a higher level. The issue that is occurring, is that I am only getting data from any of the streams intermittently. I restart the service 10-15 times, I might get to see data come through once.Include a reproducible code sample here, if possible:
Here is a demonstration of what I am doing:
Further details:
I haven't been able to see any errors via the
.on('error')
event. I have tested this with@discordjs/opus
andopusscript
, installedffmpeg
after I received a bizarre error there. Oddly this works once in a while, I will get data flowing and audio written to aBuffer
, then saved to a file. 90% of the time, the bot connects to the voice channel, creates the streams for each user, but nothing comes through.Relevant client options:
c4c817116f868cedb4ec20bcbf90b9b3d382621e