Skip to content

Commit

Permalink
fix: docs dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
aiko-chan-ai committed Jul 24, 2024
1 parent 515615c commit f96c623
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/main.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/client/voice/VoiceConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ class VoiceConnection extends EventEmitter {
* .then(connection => {
*
* });
* ```
* @extends {VoiceConnection}
*/
class StreamConnection extends VoiceConnection {
Expand Down
2 changes: 1 addition & 1 deletion src/client/voice/dispatcher/AudioDispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const VolumeInterface = require('../util/VolumeInterface');
* });
* ```
* @implements {VolumeInterface}
* @extends {WritableStream}
* @extends {BaseDispatcher}
*/
class AudioDispatcher extends BaseDispatcher {
constructor(player, { seek = 0, volume = 1, fec, plp, bitrate = 96, highWaterMark = 12 } = {}, streams) {
Expand Down
13 changes: 8 additions & 5 deletions src/client/voice/dispatcher/BaseDispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const nonce = Buffer.alloc(24);
* @see {@link https://nodejs.org/api/stream.html#stream_class_stream_writable}
*/

/**
* @extends {Writable}
*/
class BaseDispatcher extends Writable {
constructor(player, highWaterMark = 12, payloadType, extensionEnabled, streams = {}) {
super({
Expand Down Expand Up @@ -59,7 +62,7 @@ class BaseDispatcher extends Writable {
const streamError = (type, err) => {
/**
* Emitted when the dispatcher encounters an error.
* @event AudioDispatcher#error
* @event BaseDispatcher#error
*/
if (type && err) {
err.message = `${type} stream: ${err.message}`;
Expand Down Expand Up @@ -112,7 +115,7 @@ class BaseDispatcher extends Writable {
if (!this.startTime) {
/**
* Emitted once the stream has started to play.
* @event AudioDispatcher#start
* @event BaseDispatcher#start
*/
this.emit('start');
this.startTime = performance.now();
Expand Down Expand Up @@ -333,7 +336,7 @@ class BaseDispatcher extends Writable {
_sendPacket(packet) {
/**
* Emitted whenever the dispatcher has debug information.
* @event AudioDispatcher#debug
* @event BaseDispatcher#debug
* @param {string} info The debug info
*/
this._setSpeaking(1);
Expand Down Expand Up @@ -379,7 +382,7 @@ class BaseDispatcher extends Writable {
}
/**
* Emitted when the dispatcher starts/stops video.
* @event AudioDispatcher#videoStatus
* @event VideoDispatcher#videoStatus
* @param {boolean} value Whether or not the dispatcher is enable video
*/
this.emit('videoStatus', value);
Expand All @@ -391,7 +394,7 @@ class BaseDispatcher extends Writable {
}
/**
* Emitted when the dispatcher starts/stops video.
* @event AudioDispatcher#streamStatus
* @event VideoDispatcher#streamStatus
* @param {boolean} isPaused Whether or not the dispatcher is pause video
*/
this.emit('streamStatus', value);
Expand Down
2 changes: 1 addition & 1 deletion src/client/voice/dispatcher/VideoDispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const BaseDispatcher = require('./BaseDispatcher');
* });
* ```
* @implements {VolumeInterface}
* @extends {WritableStream}
* @extends {BaseDispatcher}
*/
class VideoDispatcher extends BaseDispatcher {
constructor(player, highWaterMark = 12, streams, fps) {
Expand Down

0 comments on commit f96c623

Please sign in to comment.