discordjs / discord.js Public
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
Discord does not support receiving audio #2929
Comments
Discord used to have a bug where bots couldn't receive audio if they didn't play any audio, it got fixed but I just tested now and it looks like it came back. There have been reports of this from users of other libraries, so my suggestion would be to consider playing a silent audio file when your bot joins a channel so that it can still receive audio until Discord fixes it. |
That worked. Thank you very much for the temporary fix. |
No problem! I'll keep this open until a Discord dev can give us more info. |
This issue is also reproduced in JDA DV8FromTheWorld/JDA#789 |
So, I tried this
where beep.mp3 is a 1 1/2h of silence lol. |
This comment has been minimized.
This comment has been minimized.
Bot listen me, when playing sound. But i have one more problem:
and stopping. Can you help me with it, please? |
I've been trying Minn's fix but it doesn't seem to be working :/ |
Putting this here for completeness |
See discord/discord-api-docs#808 (comment), I'll try the workarounds mentioned by Minn and see if they fix the issue |
Temporary workaround until Discord acknowledges and fixes the issue: const { Readable } = require('stream');
const SILENCE_FRAME = Buffer.from([0xF8, 0xFF, 0xFE]);
class Silence extends Readable {
_read() {
this.push(SILENCE_FRAME);
}
}
// play silence indefinitely, this should allow you to continue receiving audio
voiceConnection.play(new Silence(), { type: 'opus' }); |
As per discord/discord-api-docs#808 (see below), it seems that Discord does not support receiving audio and there currently seems to be no immediate intention of supporting it. I'd hate to entirely remove this feature from Discord.js because it can work with some tinkering around. However, without any documentation or communication from the developers I'm no longer going to actively maintain this feature as it's too unstable. Sorry for how this has turned out! |
Sending the silence frame only once also works for me: const { Readable } = require('stream');
const SILENCE_FRAME = Buffer.from([0xF8, 0xFF, 0xFE]);
class Silence extends Readable {
_read() {
this.push(SILENCE_FRAME);
this.destroy();
}
}
voiceConnection.play(new Silence(), { type: 'opus' }); |
Does the commit above work for you? |
Please describe the problem you are having in as much detail as possible:
When creating a readable stream for audio, no audio is received from the on data event. This used to work a month or so ago, but no longer works. No data is passed, the on end event is never passed.
Include a reproducible code sample here, if possible:
Further details:
High priority for bots needing audio receiving
The text was updated successfully, but these errors were encountered: