added large_threshold

This commit is contained in:
hydrabolt
2016-02-12 21:03:27 +00:00
parent 42f053eb9f
commit 5132c9ade4
5 changed files with 29 additions and 27 deletions

View File

@@ -1287,6 +1287,7 @@ var InternalClient = (function () {
token: self.token, token: self.token,
v: 3, v: 3,
compress: self.client.options.compress, compress: self.client.options.compress,
large_threshold: 250,
properties: { properties: {
"$os": "discord.js", "$os": "discord.js",
"$browser": "discord.js", "$browser": "discord.js",

View File

@@ -81,7 +81,7 @@ var AudioEncoder = (function () {
AudioEncoder.prototype.encodeStream = function encodeStream(stream, options) { AudioEncoder.prototype.encodeStream = function encodeStream(stream, options) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { 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); stream.pipe(enc.stdin);
@@ -107,7 +107,7 @@ var AudioEncoder = (function () {
AudioEncoder.prototype.encodeFile = function encodeFile(file, options) { AudioEncoder.prototype.encodeFile = function encodeFile(file, options) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { 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 () { enc.stdout.once("readable", function () {
resolve({ resolve({

View File

@@ -1086,6 +1086,7 @@ export default class InternalClient {
token: self.token, token: self.token,
v: 3, v: 3,
compress: self.client.options.compress, compress: self.client.options.compress,
large_threshold : 250,
properties: { properties: {
"$os": "discord.js", "$os": "discord.js",
"$browser": "discord.js", "$browser": "discord.js",