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:
Programmix
2016-05-28 20:46:23 -07:00
committed by abalabahaha
parent b4dcd657cf
commit 7cf7c0e794
2 changed files with 16 additions and 0 deletions

View File

@@ -138,9 +138,17 @@ var AudioEncoder = (function () {
var ffmpegErrors = "";
enc.stdout.pipe(this.volume);
enc.stderr.on("data", function (data) {
ffmpegErrors += "\n" + new Buffer(data).toString().trim();
});
enc.stdout.on("end", function () {
killProcess();
reject("end");
});
enc.once("exit", function (code, signal) {
if (code) {
reject(new Error("FFMPEG: " + ffmpegErrors));

View File

@@ -127,9 +127,17 @@ export default class AudioEncoder {
var ffmpegErrors = "";
enc.stdout.pipe(this.volume);
enc.stderr.on("data", (data) => {
ffmpegErrors += "\n" + new Buffer(data).toString().trim();
});
enc.stdout.on("end", () => {
killProcess();
reject("end");
});
enc.once("exit", (code, signal) => {
if (code) {
reject(new Error("FFMPEG: " + ffmpegErrors));