Compare commits
2 Commits
1316c109e9
...
999affce93
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
999affce93 | ||
|
|
2a3893b0e7 |
@@ -52,7 +52,7 @@ async function createAudioInstance() {
|
||||
channels: 2,
|
||||
format: "S16_BE",
|
||||
rate: 48000,
|
||||
device: selectedDevice.name ?? "default", // Use -1 or omit the deviceId to select the default device
|
||||
device: selectedDevice.name ?? "default", // Omit the deviceId to select the default device
|
||||
periodSize: 100, //(48000 / 1000) * 20, //(48000 * 16 * 2) / 1000 * 20 // (48000 * (16 / 8) * 2) / 60 / 1000 * 20 //0.025 * 48000 / 2
|
||||
periodTime: undefined,
|
||||
// highwaterMark: 3840
|
||||
|
||||
@@ -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);
|
||||
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);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user