mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 05:52:05 +00:00
Attempt to process volume option
This commit is contained in:
parent
13e8a39f9f
commit
25f25f5506
2 changed files with 18 additions and 1 deletions
|
|
@ -254,6 +254,9 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options.volume != null) {
|
||||||
|
this.setVolume(options.volume);
|
||||||
|
}
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
_this.encoder.encodeFile(stream, options)["catch"](error).then(function (data) {
|
_this.encoder.encodeFile(stream, options)["catch"](error).then(function (data) {
|
||||||
self.streamProc = data.proc;
|
self.streamProc = data.proc;
|
||||||
|
|
@ -283,6 +286,9 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options.volume != null) {
|
||||||
|
this.setVolume(options.volume);
|
||||||
|
}
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
_this2.encoder.encodeStream(stream, options)["catch"](error).then(function (data) {
|
_this2.encoder.encodeStream(stream, options)["catch"](error).then(function (data) {
|
||||||
self.streamProc = data.proc;
|
self.streamProc = data.proc;
|
||||||
|
|
@ -312,6 +318,9 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options.volume != null) {
|
||||||
|
this.setVolume(options.volume);
|
||||||
|
}
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
_this3.encoder.encodeArbitraryFFmpeg(ffmpegOptions)["catch"](error).then(function (data) {
|
_this3.encoder.encodeArbitraryFFmpeg(ffmpegOptions)["catch"](error).then(function (data) {
|
||||||
self.streamProc = data.proc;
|
self.streamProc = data.proc;
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,9 @@ export default class VoiceConnection extends EventEmitter {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options.volume != null) {
|
||||||
|
this.setVolume(options.volume);
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.encoder
|
this.encoder
|
||||||
.encodeFile(stream, options)
|
.encodeFile(stream, options)
|
||||||
|
|
@ -243,6 +246,9 @@ export default class VoiceConnection extends EventEmitter {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options.volume != null) {
|
||||||
|
this.setVolume(options.volume);
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.encoder
|
this.encoder
|
||||||
.encodeStream(stream, options)
|
.encodeStream(stream, options)
|
||||||
|
|
@ -270,6 +276,9 @@ export default class VoiceConnection extends EventEmitter {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options.volume != null) {
|
||||||
|
this.setVolume(options.volume);
|
||||||
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.encoder
|
this.encoder
|
||||||
.encodeArbitraryFFmpeg(ffmpegOptions)
|
.encodeArbitraryFFmpeg(ffmpegOptions)
|
||||||
|
|
@ -280,7 +289,6 @@ export default class VoiceConnection extends EventEmitter {
|
||||||
var intent = self.playStream(data.stream);
|
var intent = self.playStream(data.stream);
|
||||||
resolve(intent);
|
resolve(intent);
|
||||||
callback(null, intent);
|
callback(null, intent);
|
||||||
|
|
||||||
});
|
});
|
||||||
function error(e = true) {
|
function error(e = true) {
|
||||||
reject(e);
|
reject(e);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue