mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
Attempted to understand volume code and retry fixes
This commit is contained in:
@@ -124,19 +124,16 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
count = 0,
|
||||
length = 20,
|
||||
retStream = new _StreamIntent2["default"](),
|
||||
onWarning = false,
|
||||
lastVolume = this.volume !== undefined ? this.volume.get() : 1;
|
||||
onWarning = false;
|
||||
|
||||
this.volume = stream;
|
||||
this.playing = true;
|
||||
this.playingIntent = retStream;
|
||||
|
||||
this.setVolume(lastVolume);
|
||||
|
||||
function send() {
|
||||
if (!self.playingIntent || !self.playing) {
|
||||
self.setSpeaking(false);
|
||||
retStream.emit("end");
|
||||
//console.log("ending 1");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -147,7 +144,6 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
if (onWarning) {
|
||||
retStream.emit("end");
|
||||
self.setSpeaking(false);
|
||||
//console.log("ending 2");
|
||||
return;
|
||||
} else {
|
||||
onWarning = true;
|
||||
@@ -253,9 +249,7 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
if (options.volume != null) {
|
||||
this.setVolume(options.volume);
|
||||
}
|
||||
options.volume = options.volume !== undefined ? options.volume : this.getVolume();
|
||||
return new Promise(function (resolve, reject) {
|
||||
_this.encoder.encodeFile(stream, options)["catch"](error).then(function (data) {
|
||||
self.streamProc = data.proc;
|
||||
@@ -285,9 +279,7 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
if (options.volume != null) {
|
||||
this.setVolume(options.volume);
|
||||
}
|
||||
options.volume = options.volume !== undefined ? options.volume : this.getVolume();
|
||||
return new Promise(function (resolve, reject) {
|
||||
_this2.encoder.encodeStream(stream, options)["catch"](error).then(function (data) {
|
||||
self.streamProc = data.proc;
|
||||
@@ -317,9 +309,7 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
if (options.volume != null) {
|
||||
this.setVolume(options.volume);
|
||||
}
|
||||
options.volume = options.volume !== undefined ? options.volume : this.getVolume();
|
||||
return new Promise(function (resolve, reject) {
|
||||
_this3.encoder.encodeArbitraryFFmpeg(ffmpegOptions)["catch"](error).then(function (data) {
|
||||
self.streamProc = data.proc;
|
||||
|
||||
Reference in New Issue
Block a user