mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Add highWaterMark
This commit is contained in:
@@ -439,8 +439,11 @@ class VoiceConnection extends EventEmitter {
|
|||||||
* @property {number} [passes=1] How many times to send the voice packet to reduce packet loss
|
* @property {number} [passes=1] How many times to send the voice packet to reduce packet loss
|
||||||
* @property {number} [plp] Expected packet loss percentage
|
* @property {number} [plp] Expected packet loss percentage
|
||||||
* @property {boolean} [fec] Enabled forward error correction
|
* @property {boolean} [fec] Enabled forward error correction
|
||||||
* @property {number|string} [bitrate=96] The bitrate (quality) of the audio in kbps
|
* @property {number|string} [bitrate=96] The bitrate (quality) of the audio in kbps.
|
||||||
* If set to 'auto', the voice channel's bitrate will be used
|
* If set to 'auto', the voice channel's bitrate will be used
|
||||||
|
* @property {number} [highWaterMark=8] The maximum number of opus packets to make and store before they are
|
||||||
|
* actually needed. See https://nodejs.org/en/docs/guides/backpressuring-in-streams/. Setting this value to
|
||||||
|
* 1 means that changes in volume will be more instant.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,8 +29,11 @@ nonce.fill(0);
|
|||||||
* @extends {stream.Writable}
|
* @extends {stream.Writable}
|
||||||
*/
|
*/
|
||||||
class StreamDispatcher extends Writable {
|
class StreamDispatcher extends Writable {
|
||||||
constructor(player, { seek = 0, volume = 1, passes = 1, fec, plp, bitrate = 96 } = {}, streams) {
|
constructor(
|
||||||
const streamOptions = { seek, volume, passes, fec, plp, bitrate };
|
player,
|
||||||
|
{ seek = 0, volume = 1, passes = 1, fec, plp, bitrate = 96, highWaterMark = 8 } = {},
|
||||||
|
streams) {
|
||||||
|
const streamOptions = { seek, volume, passes, fec, plp, bitrate, highWaterMark };
|
||||||
super(streamOptions);
|
super(streamOptions);
|
||||||
/**
|
/**
|
||||||
* The Audio Player that controls this dispatcher
|
* The Audio Player that controls this dispatcher
|
||||||
|
|||||||
Reference in New Issue
Block a user