Fixed memory leaks

This commit is contained in:
hydrabolt
2015-11-08 10:09:49 +00:00
parent 99a63db142
commit 04c3dbedac
7 changed files with 121 additions and 113 deletions

View File

@@ -23,9 +23,10 @@ var AudioEncoder = (function () {
var self = this;
return new Promise(function (resolve, reject) {
var enc = cpoc.spawn("ffmpeg", ["-i", file, "-f", "s16le", "-ar", "48000", "-ac", "1", "-af", "volume=1", "pipe:1"]);
var enc = cpoc.spawn("ffmpeg", ["-i", file, "-f", "s16le", "-ar", "48000", "-ac", "1", // this can be 2 but there's no point, discord makes it mono on playback, wasted bandwidth.
"-af", "volume=1", "pipe:1"]);
enc.stdout.on("readable", function () {
enc.stdout.once("readable", function () {
callback(null, {
proc: enc,
stream: enc.stdout