desi
desi
DIAdiscord.js - Imagine an app
Created by desi on 2/23/2024 in #djs-voice
receiver end event not triggering
Hello, does anyone know why my end event is never triggering? (last line)
const receiver = connection.receiver;

const audioStream = receiver.subscribe(user, {
end: {
behavior: 'after-silence',
duration: 50
}});

audioStream.on('data', (data) => {
const decoded = opusEncoder.decode(data);
audioData = Buffer.concat([audioData, decoded]);
});

audioStream.on('end', () => {
console.log("User stopped speaking");
});
const receiver = connection.receiver;

const audioStream = receiver.subscribe(user, {
end: {
behavior: 'after-silence',
duration: 50
}});

audioStream.on('data', (data) => {
const decoded = opusEncoder.decode(data);
audioData = Buffer.concat([audioData, decoded]);
});

audioStream.on('end', () => {
console.log("User stopped speaking");
});
Data is received correctly, but the end never happens. Any suggestions, please?
3 replies