Nitsugua38
Nitsugua38
DIAdiscord.js - Imagine an app
Created by Nitsugua38 on 8/29/2024 in #djs-voice
How to include silence in vc recording
I’m trying to record a vc, I’m using this and the module mediaplex for the opus encoder:
const listenStream = connection.receiver.subscribe(member.id, {
end: {
behavior: EndBehaviorType.Manual,
}
});

const opusDecoder = new OpusEncoder(48000, 2);

listenStream.on("data", (packet) => {
const decoded = opusDecoder.decode(packet);
writeStream.write(decoded);
});
const listenStream = connection.receiver.subscribe(member.id, {
end: {
behavior: EndBehaviorType.Manual,
}
});

const opusDecoder = new OpusEncoder(48000, 2);

listenStream.on("data", (packet) => {
const decoded = opusDecoder.decode(packet);
writeStream.write(decoded);
});
The problem here is it won’t record the silences when a member stops speaking for 5 seconds for exemple, is there a way to add them manually, so the length of the final audio is reflective of the actual time the member was recorded for, and not just the moments where they speak?
9 replies