Remove double buffer and added logging

Would likely work on RPI3 but need to figure out issue with opus and RPi4
This commit is contained in:
Logan Cusano
2023-03-30 18:09:47 -04:00
parent 2a3893b0e7
commit 999affce93

View File

@@ -42,9 +42,9 @@ exports.join = async function join({interaction= undefined, guildID= undefined,
const audioInstance = await createAudioInstance();
audioInstance.on('audio', (buffer) => {
buffer = Buffer.from(buffer);
log.DEBUG("Audio buffer: ", buffer);
const encoded = encoder.encode(buffer);
const encoded = encoder.encode(buffer);
log.DEBUG("Encoded packet: ", encoded);
// TODO Add a function here to check the volume of either buffer and only play audio to discord when there is audio to be played
voiceConnection.playOpusPacket(encoded);
})