mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Another attempted fix (w/ help from izy521) (#386)
* Fix my very silly mistake * Another FFMPEG issue fix attempt * Add a missing semicolon Yes, I really did make a commit just for this. :) * Another attempted fix (w/ help from izy521)
This commit is contained in:
@@ -138,9 +138,17 @@ var AudioEncoder = (function () {
|
|||||||
var ffmpegErrors = "";
|
var ffmpegErrors = "";
|
||||||
|
|
||||||
enc.stdout.pipe(this.volume);
|
enc.stdout.pipe(this.volume);
|
||||||
|
|
||||||
enc.stderr.on("data", function (data) {
|
enc.stderr.on("data", function (data) {
|
||||||
ffmpegErrors += "\n" + new Buffer(data).toString().trim();
|
ffmpegErrors += "\n" + new Buffer(data).toString().trim();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
enc.stdout.on("end", function () {
|
||||||
|
killProcess();
|
||||||
|
|
||||||
|
reject("end");
|
||||||
|
});
|
||||||
|
|
||||||
enc.once("exit", function (code, signal) {
|
enc.once("exit", function (code, signal) {
|
||||||
if (code) {
|
if (code) {
|
||||||
reject(new Error("FFMPEG: " + ffmpegErrors));
|
reject(new Error("FFMPEG: " + ffmpegErrors));
|
||||||
|
|||||||
@@ -127,9 +127,17 @@ export default class AudioEncoder {
|
|||||||
var ffmpegErrors = "";
|
var ffmpegErrors = "";
|
||||||
|
|
||||||
enc.stdout.pipe(this.volume);
|
enc.stdout.pipe(this.volume);
|
||||||
|
|
||||||
enc.stderr.on("data", (data) => {
|
enc.stderr.on("data", (data) => {
|
||||||
ffmpegErrors += "\n" + new Buffer(data).toString().trim();
|
ffmpegErrors += "\n" + new Buffer(data).toString().trim();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
enc.stdout.on("end", () => {
|
||||||
|
killProcess();
|
||||||
|
|
||||||
|
reject("end");
|
||||||
|
});
|
||||||
|
|
||||||
enc.once("exit", (code, signal) => {
|
enc.once("exit", (code, signal) => {
|
||||||
if (code) {
|
if (code) {
|
||||||
reject(new Error("FFMPEG: " + ffmpegErrors));
|
reject(new Error("FFMPEG: " + ffmpegErrors));
|
||||||
|
|||||||
Reference in New Issue
Block a user