mirror of
https://github.com/danbulant/discord.js
synced 2026-07-03 10:10:49 +00:00
some voice docs
This commit is contained in:
parent
968883ec35
commit
26de908cfd
2 changed files with 14 additions and 1 deletions
|
|
@ -3,13 +3,26 @@ const OpusEncoders = require('../opus/OpusEngineList');
|
||||||
const EventEmitter = require('events').EventEmitter;
|
const EventEmitter = require('events').EventEmitter;
|
||||||
const StreamDispatcher = require('../dispatcher/StreamDispatcher');
|
const StreamDispatcher = require('../dispatcher/StreamDispatcher');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the Audio Player of a Voice Connection
|
||||||
|
* @extends {EventEmitter}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
class AudioPlayer extends EventEmitter {
|
class AudioPlayer extends EventEmitter {
|
||||||
constructor(voiceConnection) {
|
constructor(voiceConnection) {
|
||||||
super();
|
super();
|
||||||
|
/**
|
||||||
|
* The voice connection the player belongs to
|
||||||
|
* @type {VoiceConnection}
|
||||||
|
*/
|
||||||
this.voiceConnection = voiceConnection;
|
this.voiceConnection = voiceConnection;
|
||||||
this.audioToPCM = new (PCMConverters.fetch())();
|
this.audioToPCM = new (PCMConverters.fetch())();
|
||||||
this.opusEncoder = OpusEncoders.fetch();
|
this.opusEncoder = OpusEncoders.fetch();
|
||||||
this.currentConverter = null;
|
this.currentConverter = null;
|
||||||
|
/**
|
||||||
|
* The current stream dispatcher, if a stream is being played
|
||||||
|
* @type {StreamDispatcher}
|
||||||
|
*/
|
||||||
this.dispatcher = null;
|
this.dispatcher = null;
|
||||||
this.audioToPCM.on('error', e => this.emit('error', e));
|
this.audioToPCM.on('error', e => this.emit('error', e));
|
||||||
this.streamingData = {
|
this.streamingData = {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ const Discord = require('../');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const client = new Discord.Client({ fetchAllMembers: false, apiRequestMethod: 'sequential' });
|
const client = new Discord.Client({ fetchAllMembers: false, apiRequestMethod: 'burst' });
|
||||||
|
|
||||||
const { email, password, token, usertoken, song } = require('./auth.json');
|
const { email, password, token, usertoken, song } = require('./auth.json');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue