mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
Fix redeclaration
This commit is contained in:
@@ -117,7 +117,7 @@ export default class AudioEncoder {
|
||||
if (!command) return reject(new Error('FFMPEG not found. Make sure it is installed and in path.'));
|
||||
|
||||
// add options discord.js needs
|
||||
var ffmpegOptions = ffmpegOptions.concat([
|
||||
ffmpegOptions = ffmpegOptions.concat([
|
||||
'-f', 's16le',
|
||||
'-ar', '48000',
|
||||
'-ac', 2,
|
||||
|
||||
@@ -238,14 +238,14 @@ export default class VoiceConnection extends EventEmitter {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.encoder
|
||||
.encodeFile(stream, options)
|
||||
.catch(error)
|
||||
.then(data => {
|
||||
self.streamProc = data.proc;
|
||||
var intent = self.playStream(data.stream, 2);
|
||||
resolve(intent);
|
||||
callback(null, intent);
|
||||
|
||||
});
|
||||
})
|
||||
.catch(error);
|
||||
function error(e = true) {
|
||||
reject(e);
|
||||
callback(e);
|
||||
@@ -267,15 +267,14 @@ export default class VoiceConnection extends EventEmitter {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.encoder
|
||||
.encodeStream(stream, options)
|
||||
.catch(error)
|
||||
.then(data => {
|
||||
self.streamProc = data.proc;
|
||||
self.instream = data.instream;
|
||||
var intent = self.playStream(data.stream);
|
||||
resolve(intent);
|
||||
callback(null, intent);
|
||||
|
||||
});
|
||||
})
|
||||
.catch(error);
|
||||
function error(e = true) {
|
||||
reject(e);
|
||||
callback(e);
|
||||
@@ -300,14 +299,14 @@ export default class VoiceConnection extends EventEmitter {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.encoder
|
||||
.encodeArbitraryFFmpeg(ffmpegOptions, options)
|
||||
.catch(error)
|
||||
.then(data => {
|
||||
self.streamProc = data.proc;
|
||||
self.instream = data.instream;
|
||||
var intent = self.playStream(data.stream);
|
||||
resolve(intent);
|
||||
callback(null, intent);
|
||||
});
|
||||
})
|
||||
.catch(error);
|
||||
function error(e = true) {
|
||||
reject(e);
|
||||
callback(e);
|
||||
|
||||
Reference in New Issue
Block a user