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:
@@ -42,9 +42,9 @@ exports.join = async function join({interaction= undefined, guildID= undefined,
|
|||||||
const audioInstance = await createAudioInstance();
|
const audioInstance = await createAudioInstance();
|
||||||
|
|
||||||
audioInstance.on('audio', (buffer) => {
|
audioInstance.on('audio', (buffer) => {
|
||||||
buffer = Buffer.from(buffer);
|
|
||||||
log.DEBUG("Audio buffer: ", 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
|
// 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);
|
voiceConnection.playOpusPacket(encoded);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user