From 3df56540e2ca4adbd4ae018b2e296aeeb5bca0c3 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 23 Mar 2019 12:22:55 +0000 Subject: [PATCH] voice: add documentation to VoiceBroadcast --- src/client/voice/VoiceBroadcast.js | 4 ++++ src/client/voice/dispatcher/BroadcastDispatcher.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/client/voice/VoiceBroadcast.js b/src/client/voice/VoiceBroadcast.js index 27c8f7e28..870798dd8 100644 --- a/src/client/voice/VoiceBroadcast.js +++ b/src/client/voice/VoiceBroadcast.js @@ -27,6 +27,10 @@ class VoiceBroadcast extends EventEmitter { * @type {Client} */ this.client = client; + /** + * The dispatchers playing this broadcast + * @type {Set} + */ this.dispatchers = new DispatcherSet(this); this.player = new BroadcastAudioPlayer(this); } diff --git a/src/client/voice/dispatcher/BroadcastDispatcher.js b/src/client/voice/dispatcher/BroadcastDispatcher.js index e5c7650cf..d7fd8dfaf 100644 --- a/src/client/voice/dispatcher/BroadcastDispatcher.js +++ b/src/client/voice/dispatcher/BroadcastDispatcher.js @@ -29,6 +29,12 @@ class BroadcastDispatcher extends StreamDispatcher { super._destroy(err, cb); } + /** + * Set the bitrate of the current Opus encoder if using a compatible Opus stream. + * @param {number} value New bitrate, in kbps + * If set to 'auto', 48kbps will be used + * @returns {boolean} true if the bitrate has been successfully changed. + */ setBitrate(value) { if (!value || !this.streams.opus || !this.streams.opus.setBitrate) return false; const bitrate = value === 'auto' ? 48 : value;