Fixed process removing

This commit is contained in:
hydrabolt
2015-11-07 21:33:38 +00:00
parent 2e43117500
commit 48c3770caf
6 changed files with 73 additions and 13 deletions

View File

@@ -26,8 +26,14 @@ var AudioEncoder = (function () {
var enc = cpoc.spawn("ffmpeg", ["-i", file, "-f", "s16le", "-ar", "48000", "-ac", "1", "-af", "volume=1", "pipe:1"]);
enc.stdout.on("readable", function () {
callback(null, enc.stdout);
resolve(enc.stdout);
callback(null, {
proc: enc,
stream: enc.stdout
});
resolve({
proc: enc,
stream: enc.stdout
});
});
enc.stdout.on("end", function () {