mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
fix(Voice*): fix speaking event and voice receive (#3749)
* fix(Voice*): synthesize speaking event from UDP packets * fix(VoiceReceiver): skip over undocumented Discord byte See #3555 * fix(VoiceConnection): play frame silence before emitting ready * typings: account for changes in private api
This commit is contained in:
16
src/client/voice/util/Silence.js
Normal file
16
src/client/voice/util/Silence.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const { Readable } = require('stream');
|
||||
|
||||
const SILENCE_FRAME = Buffer.from([0xF8, 0xFF, 0xFE]);
|
||||
|
||||
/**
|
||||
* A readable emitting silent opus frames.
|
||||
* @extends {Readable}
|
||||
* @private
|
||||
*/
|
||||
class Silence extends Readable {
|
||||
_read() {
|
||||
this.push(SILENCE_FRAME);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Silence;
|
||||
Reference in New Issue
Block a user