discord.js-selfbot-v13
discord.js-selfbot-v13 copied to clipboard
RecordingAudio.js doesn't work correctly
Which package has the bugs?
The core library
Issue description
How to reproduce
- copy this code
- run (
node RecordingAudio.js) - Noise-filled sound coming from Speaker
Observed Behavior
Able to hear audio normally
Expected Behavior
Noise-filled sound coming from the speaker
Code sample
Copy&Pasted from example
const { Client } = require('discord.js-selfbot-v13');
const client = new Client();
const fs = require('fs');
const Speaker = require('speaker');
client.on('ready', async client => {
console.log(`${client.user.username} is ready!`);
const speaker = new Speaker({
channels: 2, // 2 channels
bitDepth: 16, // 16-bit samples
sampleRate: 48000, // 48000 Hz sample rate
});
const channel = client.channels.cache.get('voice_id');
const connection = await client.voice.joinChannel(channel, {
selfMute: true,
selfDeaf: true,
selfVideo: false,
});
const audio = connection.receiver.createStream('user_id', {
mode: 'pcm',
end: 'manual',
paddingSilence: true,
});
audio.pipe(fs.createWriteStream('test.pcm'));
// After 15s
setTimeout(() => {
console.log('Stop recording');
audio.destroy();
// Play this record...
fs.createReadStream('test.pcm').pipe(speaker);
}, 15_000);
});
client.login('token');
Package version
^3.6.1
Node.js version
v22.14.0
Operating system
Ubuntu 20.04
Priority this issue should have
Medium (should be fixed soon)
Checklist
- [x] I have searched the open issues for duplicates.
- [x] I have shared the entire traceback.
- [x] I am using a user token (and it isn't visible in the code).
Additional Information
Is Discord's implementation of E2EE having an impact? I have no idea what is going on, but it is true that even the sample code is no longer working correctly.
I can confirm that playAudio() works fine.