ayman
ayman
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
Thank you so much for your help pat and qjuh too
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
Uh i guess now my original problem is now solved, im now closing this post
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
also that error does not really affect the audio so if i don't find a solution for it i would just ignore that specific error tbh
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
also i don't think i will be implementing the code you've gave me because it would change the whole structure of mines and i don't really want that, sorry about that, appreciate your help tho
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
ive figured out that i get that error when I manually stop the opus stream i guess because i set the end behavior to aftersilence and it actually worked and didn't give me any error
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
and this
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
so I should do that
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
oh yeah i knew that i supposed that you wrote receiver.speaking.on('start', receiver.subscribe) to write it faster
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
and this i have to put it in the start command:
const receiver = connection.receiver;

receiver.speaking.on('start', userId => { receiver.subscribe(userId, { end: { behavior: EndBehaviorType.Manual } }); });
const receiver = connection.receiver;

receiver.speaking.on('start', userId => { receiver.subscribe(userId, { end: { behavior: EndBehaviorType.Manual } }); });
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
this i have to put it in the end command:
for (const [k, v] of receiver.subscriptions) {
v.push(null);

const oggStream = new prism.opus.OggLogicalBitstream({
opusHead: new prism.opus.OpusHead({
channelCount: 2,
sampleRate: 48000,
}),
pageSizeControl: {
maxPackets: 10,
},
});

const filename = `./recordings/${Date.now()}-${k}.ogg`;

const out = createWriteStream(filename);

pipeline(v, oggStream, out, (err) => {
if (err) {
console.warn(`❌ Error recording file ${filename} - ${err.message}`);
} else {
console.log(`✅ Recorded ${filename}`);
}
});
}
for (const [k, v] of receiver.subscriptions) {
v.push(null);

const oggStream = new prism.opus.OggLogicalBitstream({
opusHead: new prism.opus.OpusHead({
channelCount: 2,
sampleRate: 48000,
}),
pageSizeControl: {
maxPackets: 10,
},
});

const filename = `./recordings/${Date.now()}-${k}.ogg`;

const out = createWriteStream(filename);

pipeline(v, oggStream, out, (err) => {
if (err) {
console.warn(`❌ Error recording file ${filename} - ${err.message}`);
} else {
console.log(`✅ Recorded ${filename}`);
}
});
}
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
wait so
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
like that?
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
const receiver = connection.receiver;

receiver.speaking.on('start', receiver.subscribe)

for (const [k, v] of receiver.subscriptions) {
v.push(null);

const oggStream = new prism.opus.OggLogicalBitstream({
opusHead: new prism.opus.OpusHead({
channelCount: 2,
sampleRate: 48000,
}),
pageSizeControl: {
maxPackets: 10,
},
});

const filename = `./recordings/${Date.now()}-${k}.ogg`;

const out = createWriteStream(filename);

pipeline(v, oggStream, out, (err) => {
if (err) {
console.warn(`❌ Error recording file ${filename} - ${err.message}`);
} else {
console.log(`✅ Recorded ${filename}`);
}
});
}
const receiver = connection.receiver;

receiver.speaking.on('start', receiver.subscribe)

for (const [k, v] of receiver.subscriptions) {
v.push(null);

const oggStream = new prism.opus.OggLogicalBitstream({
opusHead: new prism.opus.OpusHead({
channelCount: 2,
sampleRate: 48000,
}),
pageSizeControl: {
maxPackets: 10,
},
});

const filename = `./recordings/${Date.now()}-${k}.ogg`;

const out = createWriteStream(filename);

pipeline(v, oggStream, out, (err) => {
if (err) {
console.warn(`❌ Error recording file ${filename} - ${err.message}`);
} else {
console.log(`✅ Recorded ${filename}`);
}
});
}
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
with the event
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
i managed to only save one file
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
what but is that code inside the speaking.on event?
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
should i add the if (receiver.subscriptions.has(user_id)) return; to it?
209 replies
DIAdiscord.js - Imagine an app
Created by ayman on 8/21/2024 in #djs-voice
How can I record voice from a VC using discord.js?
alr alr let me try this
209 replies