mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
added large_threshold
This commit is contained in:
@@ -1287,6 +1287,7 @@ var InternalClient = (function () {
|
||||
token: self.token,
|
||||
v: 3,
|
||||
compress: self.client.options.compress,
|
||||
large_threshold: 250,
|
||||
properties: {
|
||||
"$os": "discord.js",
|
||||
"$browser": "discord.js",
|
||||
|
||||
@@ -6,23 +6,23 @@ exports.__esModule = true;
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var TokenCacher = (function () {
|
||||
function TokenCacher() {
|
||||
_classCallCheck(this, TokenCacher);
|
||||
}
|
||||
function TokenCacher() {
|
||||
_classCallCheck(this, TokenCacher);
|
||||
}
|
||||
|
||||
TokenCacher.prototype.setToken = function setToken() {};
|
||||
TokenCacher.prototype.setToken = function setToken() {};
|
||||
|
||||
TokenCacher.prototype.save = function save() {};
|
||||
TokenCacher.prototype.save = function save() {};
|
||||
|
||||
TokenCacher.prototype.getToken = function getToken() {
|
||||
return null;
|
||||
};
|
||||
TokenCacher.prototype.getToken = function getToken() {
|
||||
return null;
|
||||
};
|
||||
|
||||
TokenCacher.prototype.init = function init(ind) {
|
||||
this.done = true;
|
||||
};
|
||||
TokenCacher.prototype.init = function init(ind) {
|
||||
this.done = true;
|
||||
};
|
||||
|
||||
return TokenCacher;
|
||||
return TokenCacher;
|
||||
})();
|
||||
|
||||
exports["default"] = TokenCacher;
|
||||
|
||||
@@ -81,7 +81,7 @@ var AudioEncoder = (function () {
|
||||
AudioEncoder.prototype.encodeStream = function encodeStream(stream, options) {
|
||||
var self = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', '-', '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 1), '-ss', (options.seek || 0), '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', '-', '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 1), '-ss', options.seek || 0, '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||
|
||||
stream.pipe(enc.stdin);
|
||||
|
||||
@@ -107,7 +107,7 @@ var AudioEncoder = (function () {
|
||||
AudioEncoder.prototype.encodeFile = function encodeFile(file, options) {
|
||||
var self = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', file, '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 1), '-ss', (options.seek || 0), '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', file, '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 1), '-ss', options.seek || 0, '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||
|
||||
enc.stdout.once("readable", function () {
|
||||
resolve({
|
||||
|
||||
@@ -5,24 +5,24 @@ exports.__esModule = true;
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var VoicePacket = function VoicePacket(data, sequence, time, ssrc) {
|
||||
_classCallCheck(this, VoicePacket);
|
||||
_classCallCheck(this, VoicePacket);
|
||||
|
||||
var audioBuffer = data,
|
||||
returnBuffer = new Buffer(audioBuffer.length + 12);
|
||||
var audioBuffer = data,
|
||||
returnBuffer = new Buffer(audioBuffer.length + 12);
|
||||
|
||||
returnBuffer.fill(0);
|
||||
returnBuffer[0] = 0x80;
|
||||
returnBuffer[1] = 0x78;
|
||||
returnBuffer.fill(0);
|
||||
returnBuffer[0] = 0x80;
|
||||
returnBuffer[1] = 0x78;
|
||||
|
||||
returnBuffer.writeUIntBE(sequence, 2, 2);
|
||||
returnBuffer.writeUIntBE(time, 4, 4);
|
||||
returnBuffer.writeUIntBE(ssrc, 8, 4);
|
||||
returnBuffer.writeUIntBE(sequence, 2, 2);
|
||||
returnBuffer.writeUIntBE(time, 4, 4);
|
||||
returnBuffer.writeUIntBE(ssrc, 8, 4);
|
||||
|
||||
for (var i = 0; i < audioBuffer.length; i++) {
|
||||
returnBuffer[i + 12] = audioBuffer[i];
|
||||
}
|
||||
for (var i = 0; i < audioBuffer.length; i++) {
|
||||
returnBuffer[i + 12] = audioBuffer[i];
|
||||
}
|
||||
|
||||
return returnBuffer;
|
||||
return returnBuffer;
|
||||
};
|
||||
|
||||
exports["default"] = VoicePacket;
|
||||
|
||||
@@ -1086,6 +1086,7 @@ export default class InternalClient {
|
||||
token: self.token,
|
||||
v: 3,
|
||||
compress: self.client.options.compress,
|
||||
large_threshold : 250,
|
||||
properties: {
|
||||
"$os": "discord.js",
|
||||
"$browser": "discord.js",
|
||||
|
||||
Reference in New Issue
Block a user